This file contains hidden or 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
/* | |
* http://jsfiddle.net/mostlygeek/etz43/ | |
* | |
* much credit goes to: http://thecodeplayer.com/walkthrough/canvas-fireworks-tutorial | |
* tweaked a few things out for performance: | |
* | |
* - revised the animation loop to stop animating when no more particles/fireworks | |
* - use `|0` to round off to nearest pixel | |
* - use a clock algorithm for trails, instead of pop() and unshift() on the array | |
*/ |
This file contains hidden or 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/bash | |
# update the system | |
sudo apt-get --yes update | |
sudo apt-get --yes upgrade | |
# node.js using PPA (for statsd) | |
sudo apt-get install --yes python-software-properties | |
sudo apt-add-repository ppa:chris-lea/node.js | |
sudo apt-get update --yes |
This file contains hidden or 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 python | |
# | |
# s3-download.py - a quick-and-dirty download script to download from S3 | |
# implemented using Boto, which automatically applies AWS IAM role credentials | |
# | |
# This code is distributed under the MIT license from | |
# http://opensource.org/licenses/MIT: | |
# | |
# Copyright (c) 2013 Martijn Koster | |
# |
This file contains hidden or 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 | |
greeting="What's up" | |
# notice `EOF` is not quoted | |
cat << EOF | |
No quotes mean I do var substitution: | |
$greeting | |
EOF |
This file contains hidden or 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 | |
BASE=$(dirname $0) | |
cd $BASE | |
./bin/mongod \ | |
--noprealloc \ | |
--cpu \ | |
--dbpath $BASE |
This file contains hidden or 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
# fix for broken pbcopy in tmux | |
# see: http://superuser.com/questions/231130/unable-to-use-pbcopy-while-in-tmux-session | |
set-option -g default-command "reattach-to-user-namespace -l bash" | |
unbind C-b | |
set -g prefix C-a | |
# allow mouse navigation (on mac) between panes | |
bind -n M-Left select-pane -L |
This file contains hidden or 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
# | |
# Source, a directory full of files like: t01-open.png, t02-open.png, etc. | |
# Output, rename the files so t01-open.png turns into t00-open.png (start at zero instead of 1) | |
# loop through all the numbers ... | |
for i in {1..20} | |
do | |
# turn 1, 2, 3, 4... into 01, 02, 03, 04 | |
f=$(echo $i | awk '{printf "%02s", $1}') |
This file contains hidden or 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
t01-close.png | |
t01-open.png | |
t01-stroke.png | |
t02-close.png | |
t02-open.png | |
t02-stroke.png | |
t03-close.png | |
t03-open.png | |
t03-stroke.png | |
t04-close.png |
This file contains hidden or 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/sed -f | |
# | |
# turing.sed -- emulate a Turing machine | |
# | |
# Christophe Blaess <[email protected]> | |
# http://perso.club-internet.fr/ccb/ | |
# See text file for information about Turing Machine script. | |
# Read all the instructions, and add a final newline. |
This file contains hidden or 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
Actor = (function() { | |
var my,own,internal,state = 0; | |
return { | |
onMessage: function(msg) { | |
if (msg == "inc") { my = my + 1 } | |
// ... | |
} | |
} |