View git.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# do this when ever u start working on a git repo | |
git clone https://github.... | |
cd <repo name> | |
git checkout -b amos | |
# do this when you have work to add | |
git add --all :/ | |
git commit -m "what u did here" | |
git push origin amos |
View gist:8698302
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | |
}); |
View gist:8698481
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | |
}*/ |
View gist:8777191
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Player(name, chips, cards) { | |
this.name = name; | |
this.chips = chips; | |
this.cards = cards || []; | |
} | |
function Card(suit, number) { | |
this.suit = suit; | |
this.number = number; | |
} |
View gist:8777234
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var texasHoldem = { | |
game: { | |
potSize: 0, | |
players: 0, | |
player: {}, | |
bet: {} | |
}, | |
makeGame: function (playersArray) { | |
this.game.player = playersArray; |
View gist:8777665
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var texasHoldem = (function(){ | |
var game = { | |
pot_size: 0, | |
players: 0, | |
player: [], | |
bet: {}, | |
deck: [] | |
}; | |
function makeDeck() { |
View gist:8960923
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "} ); | |
}); |
View gist:791ff30b27bfde9dc581
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ip.json | |
{ | |
"192.168.2.1" : { | |
"pass" : true | |
}, | |
"0.0.0.0" : { | |
"pass" : true | |
}, | |
"300.2.3333" : { | |
"pass" : false |
View gist:4dcac296294f7be58a22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( window ).unload(function() { | |
uloadEvent(); | |
}); | |
window.onunload=function(){ | |
uloadEvent(); | |
}; | |
body.onunload=function(){ | |
uloadEvent(); |
View gist:7c3c2f63129cf33a15ae
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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'; |
OlderNewer