Skip to content

Instantly share code, notes, and snippets.

@espringe
espringe / ditch.md
Last active August 29, 2015 14:06
Ditch

DITCH - THE BLUFFERS GAME

Ditch is a N player card game, played with a special deck, with the cards from 1 (the worst) to 100 (the best).

THE DRAW

Ditch is 2-6 player game, played with a 13 card deck:
2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace
Ace beats King. King beats Queen, etc.
The Ante:
---------
All players start by putting $1 in the pot.
@espringe
espringe / fow.js
Last active August 29, 2015 14:01
fow.js
/*
Fire Oil Water
--------------
FOW is a two player game, where each turn a player must spend $1 and throw down either Fire 'F', Oil 'O', or Water 'W'.
Fire beats Oil
Oil beats Water
Water beats Fire
@espringe
espringe / up4.md
Last active August 29, 2015 14:00
unpredictable-four

Unpredictable Four

Unpredictable Four is a 2 player game, where the crazy and the psychic take turns to win.

The game begins with the crazy:

The Crazy

The crazy must move by selecting either stars or moon. The primary goal of the crazy is to make the same selection four times in a row, without being predicted. The move of the crazy is not revealed until after the psychic has had their turn to predict it. After the crazy, the psychic always moves next.

@espringe
espringe / gist:8797477
Created February 4, 2014 02:59
Delete all
db.allDocs(function (err, response) {
assert(!err)
assert(response['total_rows'] === response.rows.length);
for (var i = 0; i < response.rows.length; ++i) {
response.rows[i]['_deleted'] = true;
}
db.bulkDocs({ docs: response.rows }, function(err) {
assert(!err);
return function(what) {
console.log('What is: ... ', what);
function map(doc) {
if (doc.type === what)
emit(doc._id, doc);
}
Database.query(map, function(){});
}
var http = require('http');
var options = {
hostname: 'localhost',
port: 3000,
path: '/'
//, agent: false if you uncomment this, it works..
};
function makeRequest() {
@espringe
espringe / gist:6379639
Last active December 21, 2015 23:08
nodejitsu error
Erics-MacBook-Pro:server espringe$ jitsu deploy
info: Welcome to Nodejitsu ericagave
info: jitsu v0.13.1, node v0.10.12
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in node server.js
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write /Users/espringe/workspace/contribute/server/package.json
data:
@espringe
espringe / we-need-a-better-way.md
Last active December 17, 2015 23:39
Call for a better way to share and use code

We need a way way better way of simply publishing and using simple libraries, functions, classes etc.

Or for people who prefer a convoluted example:

I wanted to add a precondition to my function that every element is unique. If there's a duplicate, a helpful assert should crash the program (in dev mode, at least).

A quick hackish solution might be to use (scala's) standard library, with:

@espringe
espringe / gist:5649435
Created May 25, 2013 15:21
scoobi branches
6c607569c8d428600b0118e79f1f48dfa073e62e branch 'master' of github.com:NICTA/scoobi
486e5635ae02a8902e5edc9c4db4ca6509351161 not-for-merge branch '0.6.0-cdh4' of github.com:NICTA/scoobi
72da5ac6afe75266f1c8e5bb858f9b3791c85051 not-for-merge branch '0.6.3' of github.com:NICTA/scoobi
f2edcd86ed6a2e9b77fb4a540253651ed1da911c not-for-merge branch '0.7.0-2.9.2' of github.com:NICTA/scoobi
2fe7aff24e3fce8c2e176316fab4aed5433041f8 not-for-merge branch '0.7.0-SNAPSHOT' of github.com:NICTA/scoobi
b118110415e47c4ae0ec43d710d1eaa928359e5b not-for-merge branch '0.7.0-cdh3' of github.com:NICTA/scoobi
4f79181a7a3362f9e793a0921e013e6445cfa792 not-for-merge branch '0.7.0-kiama' of github.com:NICTA/scoobi
d200d39150b2d4e698a6ac68f360e4040ce57560 not-for-merge branch '0.7.0-kiama-publish' of github.com:NICTA/scoobi
ac38dbdd53576b591a5aef78707351bb9e55583b not-for-merge branch 'cdh3' of github.com:NICTA/scoobi
742e185586ebc048105c2b00c66f94b3c89ac90f not-for-merge branch 'cdh3-publish' of github.com:NICTA/scoobi