Ben Vinegar benvinegar

View gist:5889180
1 2 3 4 5 6 7 8 9 10
~ » curl -s -D - https://github.com -o /dev/null ben@Sinclair-2
HTTP/1.1 200 OK
Server: GitHub.com
Date: Sat, 29 Jun 2013 00:52:59 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Status: 200 OK
Cache-Control: private, max-age=0, must-revalidate
Strict-Transport-Security: max-age=2592000
X-Frame-Options: deny
View gist:3361951
1 2 3 4 5
List of websites that force anonymous visitors to sign in to view content indexed by Google:
 
quora.com
estocksdaily.com
travelzoo.com
View gist:3208798
1 2 3 4 5 6 7 8 9
// Execute fn for each element in arr, releasing to the UI
// thread (via underscore's _.defer) between each execution
 
_.chainedDefer = (function () {
function next(arr, fn, scope) {
if (!arr.length)
return;
fn.call(scope, arr.shift());
View gist:3140509
1 2 3 4 5 6 7 8 9
// no document ready check - put this at the end of <body>
 
;(function() {
var pre = Array.prototype.slice.call(document.getElementsByTagName('code'));
 
pre.forEach(function (p) {
p.setAttribute('contenteditable', 'true');
});
})();
View gist:2474195
1 2 3 4 5 6 7 8 9 10
function forEach(arr, fn) {
var impl = fn.toString();
var m = impl.match(/function \((\w+),?\s*(\w+)?\) { (.*) }/);
var arg0 = m[1];
var arg1 = m[2];
var body = m[3];
var program = [];
program.push('var ' + arg0 + ';');
if (arg1)
program.push('var ' + arg1 + ';');
View subdomain.js
1 2 3 4 5 6 7 8 9
/**
* Replace $.ajax on your subdomain with a copy taken
* from your base domain. All jQuery AJAX actions go
* through $.ajax (i.e. $.get, $.post), so it's all good.
*/
(function() {
var iframe,
onload,
queue = [],
View gist:727646
1 2 3 4 5 6 7 8 9
//--------------------------------------------------
// Get binary value of checkbox checked/not-checked
//--------------------------------------------------
 
// Seen often:
$('selector').attr('checked') ? 1 : 0;
 
// Alternatively:
Number($('selector').is(':checked'));
View gist:726057
1 2 3 4 5 6 7 8 9 10
// Relevant jQuery Template source:
// https://github.com/jquery/jquery-tmpl/blob/master/jquery.tmpl.js#L206
 
// Example usage: {{pretty_datetime some.date.obj}}
 
$.extend(jQuery.tmpl.tag, {
"pretty_datetime": {
open: "if($notnull_1){_.push(pretty_datetime($1a));}"
}
});
View gist:722297
1 2 3 4 5 6 7 8 9 10
#
# Configuration File for JavaScript Lint 0.2.6
# Developed by Matthias Miller (http://www.JavaScriptLint.com)
#
# This configuration file can be used to lint a collection of scripts, or to enable
# or disable warnings for scripts that are linted via the command line.
#
 
#### NOTE TO TEXTMATE BUNDLE USERS:
#### Feel free to experiment with enabling/disabling individual warnings to
View breakpoint.js
1 2 3 4 5 6 7 8 9 10
/**
* Utility lib for setting/unsetting JavaScript breakpoints
*
* Usage:
* breakpoint.set('globalMethodName');
* breakpoint.unset('globalMethodName');
*
* breakpoint.set('namespacedMethodName', namespaceObject);
* breakpoint.unset('namespacedMethodName', namespaceObject);
*/
Something went wrong with that request. Please try again.