Skip to content

Instantly share code, notes, and snippets.

View olalonde's full-sized avatar

Oli olalonde

View GitHub Profile
{
"partial_tree": {
"data": {
"value": 37618,
"hash": "epzhNrElpCnpqNS4gdqFD4hn75hIfPzKM/WmNS9Dxq0="
},
"left": {
"data": {
"value": 24614,
"hash": "mVHpwxFubNXJKOv/kuCm6IoRUGN4DlQ5f+MHjCjj2Xw="
$ git st *[master][]
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.js
# modified: package.json
# new file: test.js
#
FROM ubuntu:precise
MAINTAINER Olivier Lalonde <olalonde@gmail.com>
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y bitcoind git node
# install node
RUN apt-get install -y wget
RUN wget http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-x64.tar.gz
var _ = require('underscore'),
inflection = require('inflection'),
path = require('path');
function join (arr) {
return path.join.apply(null, arr);
}
function map (app, context) {
context = _.extend({
data Tree = Node Int [Tree] | Leaf Int deriving Show
add :: Tree -> Int
add (Node i []) = i
add (Leaf i) = i
add (Node i trees) = i + sum (map add trees)
@olalonde
olalonde / test
Last active August 29, 2015 14:13
# Testing
Testing vim gist!
some more
text
here
""
"" Gist
""
let g:gist_clip_command = 'pbcopy'
@olalonde
olalonde / gist:1003860
Created June 2, 2011 03:12
Posterous standard Google +1 button iframe
<iframe src="http://dev.syskall.com/plusone/?url={Permalink}" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" style="border:0;width:110px;height:30px;"></iframe>
@olalonde
olalonde / gist:1003872
Created June 2, 2011 03:28
Posterous tall Google +1 button iframe
<iframe src="http://dev.syskall.com/plusone/?url={Permalink}&size=tall" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" style="border:0;width:50px;height:60px;"></iframe>
@olalonde
olalonde / gist:1954722
Created March 2, 2012 01:43
utility function to compare 2 arrays deeply
// utility function, returns true if arr1 is equal to arr2
function arrays_are_equivalent(arr1, arr2, ret) {
if(ret === undefined) ret = true;
if(arr1.length != arr2.length) return false;
arr1.forEach(function(ele, i) {
if(ele instanceof Array) {
ret = ret && arrays_are_equivalent(ele, arr2[i]);
}
else if(ele !== arr2[i]) {
ret = false;