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
#!/usr/bin/env bash | |
# so that I can just do zookeeper start|status|stop|etc... | |
ZOOPIDFILE=/usr/local/var/run/zookeeper/data/zookeeper_server.pid /usr/local/Cellar/zookeeper/3.4.3/libexec/bin/zkServer.sh $1 /usr/local/etc/zookeeper/zoo.cfg |
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 assert = require('assert') | |
, zookeeper = require('zkplus') | |
, path = require('path') | |
var client = zookeeper.createClient({ | |
servers: [{ | |
host: 'localhost' | |
, port: 2181 | |
}] | |
}); |
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
> !!f | |
ReferenceError: f is not defined | |
at repl:1:4 | |
at REPLServer.self.eval (repl.js:111:21) | |
at Interface.<anonymous> (repl.js:250:12) | |
at Interface.EventEmitter.emit (events.js:88:17) | |
at Interface._onLine (readline.js:199:10) | |
at Interface._line (readline.js:517:8) | |
at Interface._ttyWrite (readline.js:735:14) | |
at ReadStream.onkeypress (readline.js:98:10) |
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 client_opts = { | |
// These are necessary only if using the client certificate authentication | |
key : fs.readFileSync('client-key.pem') | |
, cert : fs.readFileSync('client-cert.pem') | |
, ca: [ fs.readFileSync('server-cert.pem') ] | |
, port : port | |
}; | |
var cleartextStream = tls.connect(client_opts, function() { |
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
1) internal server /send should allow notifications to be posted: | |
Error: the string "Hostname/IP doesn't match certificate's altnames" was thrown, throw an Error :) | |
at Runner.fail (/usr/local/lib/node_modules/mocha/lib/runner.js:153:11) | |
at Runner.uncaught (/usr/local/lib/node_modules/mocha/lib/runner.js:426:8) | |
at process.uncaught (/usr/local/lib/node_modules/mocha/lib/runner.js:456:10) | |
at process.EventEmitter.emit (events.js:123:20) |
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
unsigned char red = ((color & 0xE0) >> 5) * (36.42857142857143); | |
unsigned char green = ((color & 0x1C) >> 2) * (36.42857142857143); | |
unsigned char blue = (color & 0x03) * 85; |
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 mongoose = require('mongoose') | |
, db = mongoose.createConnection('localhost', 'test') | |
var CommentSchema = mongoose.Schema({ | |
title : 'string' | |
}) | |
var PostSchema = mongoose.Schema({ | |
name: 'string' | |
, comments : [CommentSchema] |
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
USE ocal; | |
DROP TABLE IF EXISTS openclipart_clipart; | |
-- FILE | |
CREATE TABLE openclipart_clipart( | |
id integer NOT NULL auto_increment, | |
filename varchar(255), | |
owner integer NOT NULL, | |
PRIMARY KEY(id), |
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 sockets = [...] ; // some array of sockets | |
for(var i = 0; i < sockets.length; i++){ | |
socket.on( 'CardPick', function(data) { | |
Draft.cardPick( data, draftId, socket ); | |
// `socket` will always be the last item in `sockets` every time the callback is called on any of the sockets | |
}); | |
} |
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
* remote origin | |
Fetch URL: [email protected]:vicapow/test-repo.git | |
Push URL: [email protected]:vicapow/test-repo.git | |
HEAD branch: master | |
Remote branch: | |
master tracked | |
Local branch configured for 'git pull': | |
master merges with remote master | |
Local ref configured for 'git push': | |
master pushes to master (up to date) |