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
| // | |
| // Sass rotation mixin for IE6+ | |
| // | |
| @mixin ms-rotate($degrees) { | |
| @if (not unitless($degrees)) { $degrees: $degrees / 1deg } | |
| $deg2rad: pi() * 2 / 360; | |
| $radians: $degrees * $deg2rad; | |
| $costheta: cos($radians); | |
| $sintheta: sin($radians); |
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
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
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
| (function ($) { | |
| function background_image_url($object) { | |
| var string = $object.css('backgroundImage'), | |
| url_regex = /[("]([^()"]+)[")]/; | |
| return url_regex.exec(string)[1]; | |
| } | |
| $.fn.preload_background_image = function () { | |
| return $(this).each(function () { | |
| (new Image()).src = background_image_url($(this)); |
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
| #!/bin/sh | |
| # script for optimizing images in a directory (recursive) | |
| # pngcrush & jpegtran settings from: | |
| # http://developer.yahoo.com/performance/rules.html#opt_images | |
| # pngcrush | |
| for png in `find $1 -iname "*.png"`; do | |
| echo "crushing $png ..." | |
| pngcrush -rem alla -reduce -brute "$png" temp.png |
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
| if /(?<hour>\d?\d)\:(?<min>\d\d)(?<suffix>[pa]m)/ =~ "5:03pm" | |
| puts hour | |
| puts min | |
| puts suffix | |
| end |
NewerOlder