Skip to content

Instantly share code, notes, and snippets.

// Alternative JavaScript Syntax
Person = :(name, address) { @name!, @address! }
Person::inspect = :{ <: "{@name} lives at {@address}" }
tj := Person('TJ', '314 Bessborough ave')
bob := Person('Bob', 'Some place')
[tj, bob].each(:(person){ print(person.inspect()) })
@joshgillies
joshgillies / bespin-bookmarklet-4-mysource-matrix.js
Created January 11, 2011 01:07
WIP: Enable the Bespin Bookmarklet to enable fancy editing of MySource Matrix design parse files
javascript:(function(){var%20elem=document.createElement('script');elem.setAttribute('src','https://bespin.mozillalabs.com/bookmarklet/bookmarklet.js');document.getElementById('main_frameset').getElementsByTagName('frame')[2].contentWindow.document.body.appendChild(elem);})()
@nrabinowitz
nrabinowitz / quantize.js
Created July 25, 2011 17:19
Javascript module for color quantization, based on Leptonica
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php
@tmpvar
tmpvar / opengl-learning.md
Created August 13, 2011 23:00
Opengl factoids
@hgarcia
hgarcia / server.js
Created October 12, 2011 00:25
Vanilla exec and response
var http = require('http');
var exec = require('child_process').exec;
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
exec('curl www.yahoo.com', function (error, stdout, stderr) {
//Parse stdout/stderr if/as needed
@insin
insin / bash_prompt.sh
Created December 3, 2011 01:49 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@xspager
xspager / gunicorn
Created December 22, 2011 21:21 — forked from suda/gunicorn
Gunicorn init.d script (redhat/centos)
#!/bin/sh
### BEGIN INIT INFO
# Provides: gunicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the gunicorn server
# Description: starts gunicorn using start-stop-daemon

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})