Skip to content

Instantly share code, notes, and snippets.

View talentedmrjones's full-sized avatar

Richard A. Jones talentedmrjones

View GitHub Profile
@talentedmrjones
talentedmrjones / softlayer-objectstorage-upload.js
Created April 29, 2014 16:56
NodeJS upload file to Softlayer Object Storage Container
var
fs = require('fs'),
path = '/path/to/example.txt',
stat = fs.statSync(path), // so we can get file size
request = require('request'), // npm install request
authEndpoint = 'https://dal05.objectstorage.softlayer.net/auth/v1.0/', // region specific endpoint
apiKey = "your Api Key",
user = "your Username",
container = "your container",
filename = "example.txt"
@talentedmrjones
talentedmrjones / arguments.callee.js
Last active August 29, 2015 13:57
arguments.callee is not the "name"
(function (n) { // function has no name, is therefore "anonymous"
var i=n*2;
if (i > 4) {
return undefinedFunc(); // causes a "ReferenceError: undefinedFunc is not defined at Object.<anonymous>"
} else {
arguments.callee(i); // recurses, adding the anonymous function to the call stack
}
})(1);
@talentedmrjones
talentedmrjones / event-redelegation.js
Created October 6, 2013 21:24
BackboneJs Event Re-Delegation
Backbone.View.extend({
tagName:'div',
id:'cart',
// this.$el is created and events are initially delegated to it during view instantiation
events:{
"click .checkout":"onClick"
}
renderCount:0,
@talentedmrjones
talentedmrjones / quiz-1.md
Created September 26, 2012 16:39 — forked from ahoward/quiz-1.md
quiz-1.md
So you think you wanna be a web developer...

Fork this, update your copy with answers.

They don't need to be precise - pseudo-code is fine in most cases.

Some questions don't have correct answers.