Skip to content

Instantly share code, notes, and snippets.

@jaseemabid
jaseemabid / Curry.js
Created December 2, 2011 12:50
JavaScript Currying.
/*
* Curried code to add multiple numbers
Author : Jaseem Abid <[email protected]>
* sum() expects 2 numbers are arguments
* If 2 args are provided, it returns sum as usual.
* If one arg is provided, it returns a
function which expects one more arg. JS closures can
'remember the first argument' and work accordingly.
@jaseemabid
jaseemabid / git tutorials.md
Last active December 18, 2024 14:58 — forked from netroy/git tutorials.md
Awesome git tutorials I am finding here and there
@netroy
netroy / ReadMe.md
Created October 14, 2011 20:08
Simplest Static Webserver in Node.JS

Just install connect from npm. Run this in a directory that you'll like to serve static content from. To run on a specific port set ENV "StaticPort"

@nzakas
nzakas / stack.js
Created September 12, 2011 19:24
Stack implementation using ES6 proxies
/*
* Another ES6 Proxy experiment. This one creates a stack whose underlying
* implementation is an array. The proxy is used to filter out everything
* but "push", "pop", and "length" from the interface, making it a pure
* stack where you can't manipulate the contents.
*/
var Stack = (function(){
var stack = [],
@jaseemabid
jaseemabid / git for dummies.md
Created September 11, 2011 20:54
Git for dummies

Git for dummies

As the source code is handled by the version control system Git, it's useful to know some features used.

Submodules

The repository uses submodules, which normally are handled directly by the Makefile, but sometimes you want to be able to work with them manually.

@jaseemabid
jaseemabid / jquerify.js
Created August 5, 2011 17:26
Run this line of js in your browser addressbar to add jQuery into the page you are viewing
javascript:var s=document.createElement('script');s.setAttribute('src','http://code.jquery.com/jquery.js');document.getElementsByTagName('body')[0].appendChild(s);
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@ChillyBwoy
ChillyBwoy / cookie.js
Created May 26, 2011 00:35
Cookie functions for underscore.js
@ryankirkman
ryankirkman / couchdb_delete_non_design_docs.js
Created March 17, 2011 06:51
Delete all non-design docs in CouchDB (using cradle)
var cradle = require('cradle');
var database = 'app';
cradle.setup({
host: '127.0.0.1',
port: 5984,
auth: { username: "YOUR_USERNAME", password: "YOUR_PASSWORD" }
});
import logging
import time
logger = logging.getLogger(__name__)
def useful():
logger.debug('Hello from webapplib!')
time.sleep(0.01)