This file contains 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
'instanceof' tests results on the objects returned from the method/property below. | |
IE 8 | |
NodeList HTMLCollection StaticNodeList | |
all X | |
children X | |
childNodes X | |
getElementsByName X | |
getElementsByTagName X | |
getElementsByClassName X |
This file contains 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
// Tested in FF2 && 3.6 | |
var processor = new XSLTProcessor(), | |
xml = document.implementation.createDocument("", "", null), | |
xsl = new DOMParser().parseFromString("<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'><xsl:output method='html' /><xsl:template match='/'><html><head><title></title></head><body></body></html></xsl:template></xsl:stylesheet>", "text/xml"); | |
processor.importStylesheet(xsl); | |
// Gecko always inserts the character encoding META element (below) in the | |
// transformed HTML DOM. Manually inserting the META element in the XSL template |
This file contains 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 enabling the creation of dynamic `document` objects | |
var global = window, | |
doc = global.document; | |
function createDoc (title) { | |
var axo = "ActiveXObject", | |
chd = "createHTMLDocument", | |
xp = "XSLTProcessor", |
This file contains 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 Set (/* varargs */) { | |
var i = 0, | |
items = [].slice.call(arguments, 0); | |
this.item = function (idx) { | |
var item = items[i]; | |
if (idx != null) { | |
if (idx in items) { | |
i = idx; | |
} |
This file contains 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 linear() { | |
@return cubic-bezier(0.250, 0.250, 0.750, 0.750); } | |
@function ease() { | |
@return cubic-bezier(0.250, 0.100, 0.250, 1.000); } | |
@function ease-in() { | |
@return cubic-bezier(0.420, 0.000, 1.000, 1.000); } | |
@function ease-in-quad() { | |
@return cubic-bezier(0.550, 0.085, 0.680, 0.530); } |
This file contains 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 () { | |
// Regexp is based on Crockford's "Javascript, the Good Parts" | |
// (?:([A-Za-z]+):)? - protocol (http, ftp, etc...) (optional) | |
// (\/{0,3}) - slash(es) | |
// (?:(\w+):(\w+)@)? - username:password@ (optional) -- does this need to support hyphens and dots? | |
// ([\w\-.]+) - host name (shortened from [0-9.\-A-Za-z]+) | |
// (?::(\d+))? - port number (optional) | |
// (?:\/([^?#]*))? - match path (optional) (caution, matches all character except ? and #, so it will also match line-ending characters, control character, and lots of other characters) |
This file contains 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 http = require('http'), | |
fs = require('fs'), | |
output = './money_tiles7/', | |
// Tokens and ranges for the 1:1 detail level | |
zoom = 0, | |
xmin = 0, | |
xmax = 48, | |
ymin = 0, | |
ymax = 32, |
This file contains 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
/** | |
* Assumptions: | |
* Text is a UTF8 string | |
* Text is without HTML entities and HTML tags | |
* Suffix is added at nearest word break, excluding punctuation | |
* Length of the text string is longer than the suffix | |
* Arguments are assumed present and of correct type | |
*/ | |
(function (exports) { |
This file contains 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
// Allows programmatic altering of CSS rules. Turn this class into a flyweight by enabling modification of the underlying rule property. | |
function CssRule (selector, stylesheet) { | |
var rules = stylesheet.rules, | |
len = rules.length, | |
i = 0, | |
rule = null; | |
for (i; i < len; i++) { | |
rule = rules[i]; | |
if (rule.selectorText === selector) { |
This file contains 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
OlderNewer