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
# Find closest point to a set of points. | |
findClosestPoint = (needle, haystack) -> | |
(init = new Point).diff = Number.MAX_VALUE | |
comparator = (memo, point) -> | |
point.diff = Math.abs(needle.x - point.x) + Math.abs(needle.y - point.y) | |
if point.diff < memo.diff then point else memo | |
_.foldl haystack, comparator, init | |
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
#!/usr/bin/env zsh | |
# git-feature | |
# Written by: Gianni Chiappetta <gianni@runlevel6.org> | |
# Requires: git 1.7.5+, zsh 4.3.11+ | |
# Screenshot: http://cloud.gf3.ca/6TPb | |
function c_list { echo " \033[1;32m✔\033[0m $1"; } | |
function e_list { echo " \033[1;31m✖\033[0m $1"; } |
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 elemDisplays = {}, | |
// Store the iframe outside the function to reuse it | |
iframe; | |
function defaultDisplay( nodeName ) { | |
if ( !elemDisplays[ nodeName ] ) { | |
// Try the classical method first, which is far faster | |
var elem = document.createElement( nodeName ), | |
display; | |
document.body.appendChild( elem ); |
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 User( options ) { | |
(this.options = options || {} ).__proto__ = User.options | |
// Private | |
function utilityMethod() { return "oh hai" } | |
// Public | |
this.say = function say() { | |
return this.options.awesome ? utilityMethod() : ':(' | |
} |
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
3 tenets of science: measurability, falsifiability, and repeatability | |
Advertising and lack/desire | |
Advertising as an imagined future | |
Analogue/Digital | |
Appadurai, Arjun | |
Baudrillard, Jean | |
Beaubourg | |
Benjamin, Walter | |
Bilal, Wafaa | |
Brand, Stewart |
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
// Proto-classy | |
function Book ( a_auth, a_email, options ) { var author, email | |
this.options = options || {} | |
this.options.__proto__ = Book.options | |
author = a_auth | |
email = a_email | |
accessor.call( this, 'author' | |
, function() { return 'Author: ' + author } |
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() { | |
var css = | |
[ '/css/default.css' | |
, '/css/section.css' | |
, '/css/custom.css' | |
] | |
, i = -1 | |
, link = document.createElement( 'link' ) | |
, head = document.getElementsByTagName( 'head' )[0] | |
, tmp |
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
/* ------------------------------ Main Class ------------------------------ */ | |
// Returns "instances" of itself which are actually functions. | |
function Ben ( greeting ) { var Parent, scope | |
function Scope () { | |
// Here is where you put your normal constructor junk | |
this.greeting = greeting | |
this.colours = [ 'yellow', 0xFFFFFF ] | |
} | |
// Magic |
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#bind(context [, arg1 [, arg2 [, argN]]]) -> Function | |
* - context (Object): Object context to bind to. | |
* - arg1 (?): Optional argument to curry. | |
* | |
* Bind a function to a given `context`. Optionally curry arguments. | |
* | |
* ### Examples | |
* | |
* var new_func = my_func.bind(my_object, "no u"); |
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
#!/bin/sh | |
# Regenerate ctags on checkout | |
# project/.git/hooks/post-checkout | |
DIR=$GIT_DIR | |
if [ 0 -eq $3 ]; then | |
# file checkout | |
else | |
# tree checkout |