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
| //A somewhat conservative test for supporting characters. | |
| //Actually, it's a test to see if the glyphs of two characters | |
| //are identical. This tends to work, however, some implementations | |
| //may instead replace the text with a box with the hex code | |
| //and this wouldn't work in those cases. One way might be to detect | |
| //the presence of a rectangular box, but that may cause issues with | |
| //glyphs that are rectangluar boxes (eg. Mail symbol). |
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
| // This is my proto library but without changing Object.prototype | |
| // Then only sub-objects of Class have the special properties. | |
| var Class = module.exports = Object.create(Object.prototype, { | |
| // Implements a forEach much like the one for Array.prototype.forEach, but for | |
| // any object. | |
| forEach: {value: function forEach(callback, thisObject) { | |
| var keys = Object.keys(this); | |
| var length = keys.length; | |
| for (var i = 0; i < length; i++) { | |
| var key = keys[i]; |
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
| build: | |
| @echo "Combining files ..." | |
| @cat \ | |
| js/dep/jquery.easing.js \ | |
| js/dep/jquery.jsonp.js \ | |
| js/dep/json2.js \ | |
| js/dep/toolbox.expose.js \ | |
| js/lib/jquery.transloadit2.js > build/jquery.transloadit2.js | |
| @echo "Compiling with Closure REST API ..." | |
| @curl \ |
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
| <style> | |
| @font-face { | |
| font-family: 'foo'; | |
| /* this font only contains the glyphs 'f' & 'o' */ | |
| } | |
| @font-face { | |
| font-family: 'bar'; | |
| /* this font only contains the glyphs 'b', 'a' & 'r' */ | |
| } | |
| .test { |
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 subpixelWordSpacing = false; | |
| if (document.defaultView && document.defaultView.getComputedStyle) { | |
| // Store the original word spacing on the document element | |
| var originalWordSpacing = document.defaultView.getComputedStyle(document.documentElement, null).wordSpacing; | |
| // Set the word-spacing to half a pixel | |
| document.documentElement.style.wordSpacing = '0.5px'; | |
| // This will return either 0px or 1px if sub-pixel word-spacing is not supported, otherwise |
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 lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Cross-browser kerning-pairs & ligatures</title> | |
| <style> | |
| body { font-family: sans-serif; background: #f4f3f3; color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; } | |
| a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px 1px 0px; -webkit-transition: background 1s ease; } | |
| a:hover { background: rgba(0, 220, 220, 0.2); } | |
| p, li { line-height: 1.5; padding: 0em 1em 0em 0em; margin: 0em 0em 0.5em; } |
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
| // this is how I fixed IE6-8 crashing on | |
| // dynamic insertion of at-rules inside | |
| // stylesheets (for example @font-face) | |
| // UPDATE: | |
| // Fix by MS, move up the style insertion | |
| // before the stylesheet rule manipulation | |
| function setStyle(rules) { | |
| var d = document, |
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
| // based on http://zaa.ch/1q | |
| $.isType = function( obj, type ) { | |
| var opt = Object.prototype.toString, | |
| result = opt.call( obj ).slice( 8, -1 ).toLowerCase(); | |
| if ( type === 'null' || type === 'undefined' ) { | |
| type = type === 'null' ? opt.call( null ) : opt.call( undefined ); | |
| type = type.slice( 8, -1 ).toLowerCase(); | |
| } |
NewerOlder