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
* html .shimmed { | |
_azimuth: expression( | |
this.shimmed = this.shimmed || 'shimmed:'+this.insertAdjacentHTML('beforeBegin','<IFRAME style="filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);position:absolute;top:0px;left:0px;width:100%;height:100%" frameBorder=0 scrolling=no src="javascript:'+"''"+'"></IFRAME>'), | |
'inherit' | |
); | |
} |
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
Array.implement('batch', function(callback, loopsPerBatch, delay, bind) { | |
if(!loopsPerBatch) loopsPerBatch = 10; | |
if(!delay) delay = 50; | |
if(callback) { | |
var loops = 0, | |
index = 0, | |
that = this; | |
function doLoops() { | |
loops = 0; | |
for (var length = that.length; (index < length) && loops < loopsPerBatch; index++) { |
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
String.implement({ | |
isURL: function() { | |
return /^(https?):\/\/((?:[a-z0-9.-]|%[0-9A-F]{2}){3,})(?::(\d+))?((?:\/(?:[a-z0-9-._~!$&'()*+,;=:@]|%[0-9A-F]{2})*)*)(?:\?((?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*))?(?:#((?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*))?$/i.test(this); | |
} | |
}); |
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
#!/usr/bin/env bash | |
# author: Thomas Aylott SubtleGradient.com | |
echo "Transmitting" | |
for i in `git log -${1:-1} $2 --name-only|grep -E '^[^ ]+$'|sort|uniq`; do | |
if [[ -e $i ]]; then | |
echo " $i" | |
open -a Transmit $i | |
fi | |
done |
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 elementInViewport(el) { | |
var rect = el.getBoundingClientRect() | |
return rect.top < (window.innerHeight || document.body.clientHeight) && rect.left < (window.innerWidth || document.body.clientWidth); | |
} | |
// and then you can use it: | |
alert(elementInViewport(document.getElementById('inner'))); | |
// or | |
alert(elementInViewport($('#inner')[0])); | |
` |
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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Updated: 2010/12/05 | |
// | |
// the regular expression composed & commented | |
// could be easily tweaked for RFC compliance, | |
// it was expressly modified to fit & satisfy | |
// these test for an URL shortener: |
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
/** | |
* Convert wildcard pattern to RegExp | |
* Pattern: | |
* * - Zero or more characters | |
* ? - Exactly one character | |
* | |
* @param {String} pattern Wildcard pattern | |
* @returns {RegExp} regular expression for wildcard matching | |
*/ | |
function wc2reg(pattern) { |
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 sendError(message, url, lineNum) { | |
var i; | |
// First check the URL and line number of the error | |
url = url || window.location.href; | |
lineNum = lineNum || 'None'; | |
// If the error is from these 3rd party script URLs, we ignore | |
// We could also just ignore errors from all scripts that aren't our own | |
var scriptURLs = [ |
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 (exports) { | |
var supportsGCS = "defaultView" in exports.document && "getComputedStyle" in exports.document.defaultView; | |
function getStyle(element, property) { | |
// `element.ownerDocument` returns the used style values relative to the | |
// element's parent document (which may be another frame). `defaultView` | |
// is required for Safari 2 support and when retrieving framed styles in | |
// Firefox 3.6 (https://github.com/jquery/jquery/pull/524#issuecomment-2241183). | |
var style = supportsGCS ? element.ownerDocument.defaultView.getComputedStyle(element, null) : element.currentStyle; | |
return (style || element.style)[property]; |
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
/** | |
* | |
* Here's a thing that will look through all the text nodes of a document, and | |
* upon encountering an emoji codepoint, will replace it with an image. | |
* For now, those images are pulled from GitHub, which isn't very nice, so I | |
* need to find a more suitable host. | |
* | |
* Much of this code was gleaned from staring at the minified GitHub JS. | |
* | |
* Copyright (c) 2013 Mark Wunsch. Licensed under the MIT License. |
OlderNewer