Monday, December 30, 2013

Saturday, December 21, 2013

Modal Window Not Displaying With AngularJS and Bootstrap

This will probably be fixed pretty soon but for now (i.e. Angular UI for Bootstrap version 0.7 and Bootstrap 3), the modal window will not display (only the backdrop will).

To make the modal window display, change "display: none" to "display: block" in the ".modal" class in the CSS. However, it will be very badly formatted. To fix the formatting issues, the markup for the modal needs to be put inside the following 2 div blocks:

<div class="modal-dialog">
<div class="modal-content">
                 <!-- modal content here→
       </div>
</div>

References:

AngularJS Logging

AngularJS has a logging service $log that can be used to log information for e.g. debugging purpose. The main advantage of using this instead of the usual "console.log" is that you can control whether debug level messages are filtered out. Additionally, you can also add decorators to add additional behaviours.

To use it, just inject "$log" as you would $scope, $location etc.

Example here: http://docs.angularjs.org/api/ng.$log

Configure the $logProvider when defining the module to enable/disable debug.

Example: http://plnkr.co/edit/HZCAoS?p=preview

Example of decorator to add additional behaviour: https://coderwall.com/p/_zporq

Downloading File using curl

When you issue a "curl <url>" command, the output will be shown on stdout. This is great when trying to read a text response but most of the time, what you're doing is downloading a file.

The easiest way to do it is "curl -O <url>". This downloads the file with the same filename as the remote file.

Wednesday, December 18, 2013

CIDR Block Cheat Sheet

This page has a cheat sheet for coming up with CIDR blocks using the "a.b.c.d/x" notation: http://whatismyipaddress.com/cidr

Thursday, December 12, 2013

Online Tool for Converting Between Sexagesimal and Decimal Notations

Latitude and Longitude are represented sometimes in decimal notation and other times in sexagesimal notations.

Here's an online tool for converting between the two: http://ghiorzi.org/sexagesi.htm