OHNY: TWA Flight Center A beautiful Flickr gallery showing the Eero Saarinen-designed TWA Flight Center. A far cry from the largely functional and brutal terminals in most airports. Folding Text Another simple Markdown-aware text editor with a few neat tricks. It has a focus mode that lets you view only the section on which you’re […]
Author Archives: Andrew
Modify the viewport based on screen width
The following snippet will cause mobile browsers to zoom in 320px of content. Useful for responsive design with fixed widths at the various breakpoints. Depends on JQuery. <script> if ($(window).width()
Weekly link dump
Bitbucket github has definitely won the majority mindshare when it comes to open source git repository hosting. If you need private repositories it can get expensive. Bitbucket is a much better option. It isn’t as social as github, but offers most of the same features for free/cheap. Perfect Workflow in Sublime Text This free course […]
Validating Canadian Postal Codes with the JQuery Validation Plugin
If you’re using the JQuery Validation Plugin, you can use the following code snippet to validate a Canadian postal code: jQuery.validator.addMethod(“cdnPostal”, function(postal, element) { return this.optional(element) || postal.match(/[a-zA-Z][0-9][a-zA-Z](-| |)[0-9][a-zA-Z][0-9]/); }, “Please specify a valid postal code.”); Then use the following rule: $(“#form”).validate({ rules: { postal_code: { required: true, cdnPostal: true } } });