Skip to content

Instantly share code, notes, and snippets.

View wmantly's full-sized avatar

William Mantly wmantly

View GitHub Profile
var extend = require('node.extend'),
redis = require("redis"),
client = redis.createClient();
exports.viewHost = function(req, res){
client.hgetall(req.params.hostName, function (err, replies) {
res.json(extend({host: req.params.hostName}, replies));
});
};
var jsonObj = new Object();
client.SMEMBERS("hosts", function (err, replies) {
replies.forEach(function(host){
client.HGETALL(host, function(err, repliesHost){
jsonObj[host] = new extend({host: host}, repliesHost);
console.log(jsonObj[host]);
});
var passwordHash = require('password-hash'),
redis = require("redis"),
client = redis.createClient(),
extend = require('node.extend');
exports.list = function(req, res){
/*if(!req.session.auth){
res.redirect('login?redirect=hosts');
}*/
function Player(name, chips, cards) {
this.name = name;
this.chips = chips;
this.cards = cards || [];
}
function Card(suit, number) {
this.suit = suit;
this.number = number;
}
var texasHoldem = {
game: {
potSize: 0,
players: 0,
player: {},
bet: {}
},
makeGame: function (playersArray) {
this.game.player = playersArray;
var texasHoldem = (function(){
var game = {
pot_size: 0,
players: 0,
player: [],
bet: {},
deck: []
};
function makeDeck() {
connection.query('INSERT INTO users (name, password) VALUES ("'+req.body.name+'", "'+hashedPassword+'")' , function(err, rows, fields) {
if (err) throw err;
res.json({actionMessage:"User <i>"+req.body.username+"</i> committed "} );
});
//ip.json
{
"192.168.2.1" : {
"pass" : true
},
"0.0.0.0" : {
"pass" : true
},
"300.2.3333" : {
"pass" : false
$( window ).unload(function() {
uloadEvent();
});
window.onunload=function(){
uloadEvent();
};
body.onunload=function(){
uloadEvent();
//requires https://github.com/janl/mustache.js
//requires jQuery
if (typeof $jq === 'undefined') $jq = {};
$( document ).ready(function(){
$( '[jq-repeat]' ).each(function(key, value){
var $this = $(value);
var repeatId = $this.attr('jq-repeat') ;
var tempId = repeatId + 'Template';