Skip to content

Instantly share code, notes, and snippets.

function PitBoss() {
this.version = function() {
return '0.0.0.0.0.1';
};
this.craps = function() {
return('<html><body>CRAP(S)! ver#' + version() + '</body></html>');
};
}
function TableTalk() {
// Prototypal
function House(){};
House.prototype = {
edge: function() {
return 0.0136;
},
fixedOdds: function() {
return true;
}
};
@kinsteronline
kinsteronline / gist:906963
Created April 7, 2011 03:15
Inspiration Imagery
http://en.wikipedia.org/wiki/File:Casino_Atari_cover.jpg
function Player() {
this.totalChips = 0.0;
}
Player.prototype.chipCount = function() {
function Player() {
this.totalChips = 0.0;
}
Player.prototype.chipCount = function() {
return this.totalChips;
};
module.exports = Player;
var pitBoss = require('pit_boss');
// How about...
pitBoss.listen(29999);
// Or...
pitBoss.set(port: 29999).start();
// Getting worse...
pitBoss.set(port: 29999, tables: 4).onDone(function() { alert('oh noes'); }).start();
@kinsteronline
kinsteronline / gist:1078947
Created July 12, 2011 20:47
One word bundle exec rake
alias brake="bundle exec rake $1"
@kinsteronline
kinsteronline / gist:1285151
Created October 13, 2011 18:57 — forked from dhh/gist:1284958
Smart use of #tap by dhh
def revoke(user)
proxy_association.owner.tap do |project|
# You can't remove the last user with access (someone has to have access to the project!)
if project.users.many?
if user.pending? && user.projects.one?
user.destroy
else
project.users.delete(user)
user.touch
end
@kinsteronline
kinsteronline / async.coffee
Created November 29, 2011 04:23 — forked from deedubs/async.coffee
Using coffeescript vowsjs for Async tests
vows = require 'vows'
assert = require 'assert'
cb = (callback) ->
setTimeout ->
callback(null, 'callback')
, 2000
andWaitForCallback = undefined