Skip to content

Instantly share code, notes, and snippets.

Jimbo jimbojw

  • Boston
Block or report user

Report or block jimbojw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:583389
// For each of the following code fragments:
// a. what does the code do?
// b. what did the author intend for it to do?
// c. how would you fix it?
// 1. list of links
var p = document.createElement('p');
for (var i=0; i<10; i++) {
var a = document.createElement('a');
a.innerHTML = "link " + i;
View show blockers.js
$(function() {
var $ol = $('#blocked_list').find('ol').eq(0);
url: '',
dataType: 'jsonp',
success: function(list) {
$.each(list, function(i,item){
$("<li><a><img /><span></span></a></li>")
View cat pictures.js
url: "",
dataType: "jsonp",
jsonp: "jsoncallback",
success: function(data){
$.each(data.items, function(i,item){
return i < 3;
View pathological-json.js
View url-in-rhino.js
// path to something you want to download
path = "http://something/you/want/to/download",
// file you want to save it as
file = new "path/to/somewhere/local" ),
// create URL object and establish connection
url = new,
View extend.js
* Extend one object with the properties of any other object(s).
* @param obj The object to extend.
* @param args Additional arguments - the objects from which to copy properties.
* @return The object which was extended.
var extend = (function(){
slice = Array.prototype.slice,
View node-scope-test.js
var sys = require('sys');
sys.puts("Top level");
sys.puts(" this === GLOBAL: " + (this === GLOBAL)); // false
sys.puts(" this === exports: " + (this === exports)); // true
var x = "1"; // local variable
sys.puts(" x === GLOBAL.x: " + (x === GLOBAL.x)); // false
You can’t perform that action at this time.