Skip to content

Instantly share code, notes, and snippets.

@gregstewart
gregstewart / hideaddrbar.js
Created September 4, 2012 11:48 — forked from scottjehl/hideaddrbar.js
Normalized hide address bar for iOS & Android
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){
@gregstewart
gregstewart / gist:2767675
Created May 22, 2012 08:48
zepto.selector.js
;(function($){
var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches
function visible(elem){
elem = $(elem)
return !!(elem.width() || elem.height()) && elem.css("display") !== "none"
}
// Implements a subset from:
// http://api.jquery.com/category/selectors/jquery-selector-extensions/
@gregstewart
gregstewart / gist:2767666
Created May 22, 2012 08:46
Turn off jQuery animations (for Jasmine)
$.fx.off = true;
@gregstewart
gregstewart / gist:2767657
Created May 22, 2012 08:43
Global Namespace checker - simplified (for Jasmine)
_global_namespace_things = [];
var _captured_global_namespace = this;
for (var prop in _captured_global_namespace) {
_global_namespace_things.push(prop);
}
@gregstewart
gregstewart / gist:2484154
Created April 24, 2012 21:53
Launch Chrome with paint rectangles visible and remote debugger
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --show-paint-rects --remote-debugging-port=9222
@gregstewart
gregstewart / gist:866034
Created March 11, 2011 15:36
Function to merge an array of PDF documents into one and another function to stamp a PDF document onto another
<cffunction name="mergePDFs" access="public" output="false" returntype="binary" hint="">
<cfargument name="pdfs" type="array" required="true" />
<cfset var document = "" />
<!--- // temp PDF file to be written to --->
<cfset var fileOut = ExpandPath("./" & createUUID() & ".pdf") />
<cfset var fileIO = "" />
<cfset var writer = "" />
<cfset var cb = "" />
<cfset var pdf = 0 />