This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var partialRight = function(fn){ | |
var args = [].slice.call(arguments); | |
var partiallyFilledArguments = args.length > 1 ? args.slice(1, args.length) : []; | |
return function(){ | |
var remainingArgs = [].slice.call(arguments); | |
return fn.apply(null, remainingArgs.concat(partiallyFilledArguments)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedadagaced | |
alias ll="ls -al" | |
alias ls="ls -G" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var log = console.log.bind(console); | |
var TWOPI = Math.PI * 2; | |
var TO_RADIANS = Math.PI / 180; | |
var Kscope = function Kscope(options) { | |
options = options || {}; | |
options.dim = options.dim || 512; | |
this.canvas = document.createElement('canvas'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************/ | |
/* This program uses the Select function to control sockets */ | |
/**************************************************************/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear(); | |
var Promise = require('bluebird'); | |
var Emitter = require('events').EventEmitter; | |
var doAsyncPromise = function(){ | |
var emitter = new Emitter(); | |
var running = new Promise(function(resolve, reject){ | |
setTimeout(function(){ | |
var state = Math.random() > 0.5; | |
return state ? resolve(state) : reject(new Error(state)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{"name": "Afghanistan", "code": "AF"}, | |
{"name": "Åland Islands", "code": "AX"}, | |
{"name": "Albania", "code": "AL"}, | |
{"name": "Algeria", "code": "DZ"}, | |
{"name": "American Samoa", "code": "AS"}, | |
{"name": "AndorrA", "code": "AD"}, | |
{"name": "Angola", "code": "AO"}, | |
{"name": "Anguilla", "code": "AI"}, | |
{"name": "Antarctica", "code": "AQ"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Backbone = require('backbone'); | |
var FSM = Backbone.Model.extend({ | |
states: { | |
"full": { | |
: [] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function map(fn, list){ | |
var ret = []; | |
if(list.length){ | |
ret = ret.concat(fn(list[0], list), map(fn, list.slice(1)) ); | |
} | |
return ret; | |
} | |
map(function(c){return c+c;}, "hey") // ["hh", "ee", "yy"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user=> (def n128 (for [a (range 1024) b (range 1024)] [b a])) | |
#'user/n128 | |
user=> (count n128) | |
1048576 | |
user=> (vec n128) | |
OutOfMemoryError Java heap space java.util.Arrays.copyOf (Arrays.java:2882) | |
user=> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns quilthing.core (:use quil.core)) | |
(defn setup [] | |
(frame-rate 1) | |
(smooth)) | |
(defn make-square [x y size] | |
;(stroke 0) | |
(no-stroke) | |
(fill (rand-int 255) (rand-int 255) (rand-int 255) (rand-int 255)) |
OlderNewer