Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
echo "Bash version ${BASH_VERSION}..."
cd ~/.vim/bundle
for plugin in ~/.vim/bundle/*
do
echo "Updating $plugin"
( cd $plugin; git pull --rebase origin master )
echo "DONE!"
@aberant
aberant / example.js
Created March 13, 2012 13:58 — forked from redsquirrel/gist:2025533
A child sending a message to its parent.
var fork = require('child_process').fork;
if (process.argv[2] == 'son') {
setTimeout(function() {
process.send({ result: 'hi dad' });
process.exit(0);
}, 1000);
} else {
var child = fork(__filename, [ 'son' ]);
child.on('message', function(m) {
require 'pp'
votes = {
"gus" => ["Colonel Panic", "Cigar Heroes"],
"shinji" => ["Bomb Squad","Taco Town"],
"nawara" => ["Colonel Panic", "Taco Town", "Danger!! Death Ray"],
"dodos" => [],
"richie" => [],
"colin" => ["Colonel Panic", "Taco Town"],
"joey" => ["Danger!! Death Ray", "Bomb Squad"]
(define (a-plus-abs-b a b)
((if (> b 0) + -) a b))
( a-plus-abs-a-b 5 6 ) ; method invocation
((if (> 6 0) + -) 5 6) ; method with paramters filed in
((+) 5 6) ; evaluate the if statemnt
(+ 5 6)
11
( define ( sum-of-squares x y )
(+ (* x x) (* y y))
)
( define ( exercise_answer x y z )
( if ( > x y )
( if ( > y z )
( sum-of-squares x y )
( sum-of-squares x z )
)
(5 + 4 + (2 - (3 - (6 + 4/5)))) / (3 * (6-2) * (2 - 7))
(+ 5 4 (2 - (3 - (6 + 4/5)))) / (3 * (6-2) * (2 - 7)) # prefix first set of addition
(+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5)))) / (3 * (6-2) * (2 - 7)) # prefix entire left side
(+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5)))) / (* 3 (- 6 2) (- 2 7)) # prefix right side
(/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) (* 3 (- 6 2) (- 2 7)) ) # prefix the rest
SICP 1.2
Fork me. Solve me.