This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create a jquery plugin that prints the given element. | |
| jQuery.fn.print = function(){ | |
| // NOTE: We are trimming the jQuery collection down to the | |
| // first element in the collection. | |
| if (this.size() > 1){ | |
| this.eq( 0 ).print(); | |
| return; | |
| } else if (!this.size()){ | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Media Queries in Sass 3.2 | |
| // | |
| // These mixins make media queries a breeze with Sass. | |
| // The media queries from mobile up until desktop all | |
| // trigger at different points along the way | |
| // | |
| // And important point to remember is that and width | |
| // over the portrait width is considered to be part of the | |
| // landscape width. This allows us to capture widths of devices | |
| // that might not fit the dimensions exactly. This means the break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| var infowindow = null; | |
| var markerArray = []; | |
| var bounds: new google.maps.LatLngBounds(); | |
| var map = new google.maps.Map(document.getElementById("map_canvas"), {zoom: 4,mapTypeId: google.maps.MapTypeId.ROADMAP}); | |
| function set_marker(lat, lng){ | |
| var position = new google.maps.LatLng(lat, lng); | |
| var marker = new google.maps.Marker({map: map, position: position}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Sort array of objects based on another array | |
| */ | |
| function mapOrder (array, order, key) { | |
| array.sort( function (a, b) { | |
| var A = a[key], B = b[key]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| iPad | |
| 1024 × 690 In landscape on iOS 4.3 | |
| 1024 × 672 In landscape on iOS 5 | |
| 768 × 946 In portrait on iOS 4.3 | |
| 768 × 928 In portrait on iOS 5 | |
| 1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3 | |
| 1024 × 644 Always showing bookmarks bar in landscape on iOS 5 | |
| 768 × 916 Always showing bookmarks bar in portrait on iOS 4.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Calculating zoom using Javascript</title> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script> | |
| <script> | |
| function hasPageBeenResized() { | |
| var isResized; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Media queries used on blog.staydecent.ca by Adrian Unger | |
| check my full source at: | |
| http://blog.staydecent.ca/static/css/style-0.1.6.css */ | |
| @media only screen and (min-width:768px) and (max-width:1269px) { | |
| /* In my particular design, I used a fluid grid limited to a | |
| max-width of 1140px, while (if there is enough room) | |
| pushing the menu outside of layout, requiring a total | |
| limit of at least 1270px. | |
| So, this first query applies to any screen-width less |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>Cross Browser CSS Page Curl Shadow</title> | |
| <style type="text/css"> | |
| body{font-family: "American Typewriter","Bookman Old Style","Palatino Linotype","Palatino",Georgia,typewriter,monos;} | |
| #page-wrap{width:960px;margin:5% auto;} | |
| .shadow-wrap{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html> | |
| <head> | |
| <title>HTML5 Audio Duration</title> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <script type="text/javascript"> | |
| var audio, duration; | |
| window.onload = function() { | |
| var element = document.createElement("audio"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // I mean, seriously, localStorage is supported even by your mum. How about instead of | |
| // casing the feature out, you give users in-memory (stale) storage instead? | |
| // If they close your application, they deserve to lose data anyway. | |
| // if (!('localStorage' in window)) { | |
| if (!Modernizr.localstorage) { | |
| window.localStorage = { | |
| _data : {}, | |
| setItem : function(id, val) { return this._data[id] = String(val); }, | |
| getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; }, |