Skip to content

Instantly share code, notes, and snippets.

View shripadk's full-sized avatar
🎯
Working

Shripad Krishna shripadk

🎯
Working
View GitHub Profile
# download libpng 1.4.x (1.5 didn't work yet with GraphicsMagick 1.3.12)
./configure --prefix=$HOME/INST && make && make install
# download libjpeg
./configure --prefix=$HOME/INST && make && make install
# download GraphicsMagick
CFLAGS=-I$HOME/INST/include LDFLAGS=-L$HOME/INST/lib ./configure --prefix=$HOME/INST --disable-openmp --disable-openmp-slow && make && make install
@shripadk
shripadk / watch_jade.js
Last active December 17, 2015 22:49
Script that watches Jade files and compiles all of them to a single javascript file.
#!/usr/bin/env node
/**
* dependencies:
* clientjade (sudo npm install -g clientjade)
* chokidar (sudo npm install chokidar)
* how to run:
* node watch_jade.js
* to render template, just call:
* jade.render(domNode, templateName, data);
*/
@shripadk
shripadk / README.md
Last active December 10, 2015 16:28 — forked from mbostock/.block
X-Mouseover with Basis line

A line chart with mouseover so that you can read the y-value based on the closest x-value. The x-value is found using d3.mouse and scale.invert. The y-value is then found by bisecting the data.

var fs = require('fs');
function removeSockFile(file) {
if(fs.existsSync(__dirname+"/tmp/"+file)) {
fs.unlinkSync(__dirname+"/tmp/"+file);
}
}
removeSockFile('app.sock');
removeSockFile('main.sock');
var http = require('http');
var cp = require('child_process');
var httpProxy = require('http-proxy');
var sentinelChild = cp.spawn('node', ['app.js'], {stdio: 'inherit'});
var agentChild = cp.spawn('node', ['agent/agent.js'], {stdio: 'inherit'});
var agent = new httpProxy.HttpProxy({
target: {
host: 'localhost',
➜ team-unknown git:(master) jitsu deploy
info: Welcome to Nodejitsu nko3-team-unknown
info: jitsu v0.11.3, node v0.8.14
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in node server.js
info: Creating snapshot 0.0.4
info Uploading: [=============================] 100%
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
/Users/shripadk/NKO/team-unknown/node_modules/redis/index.js:726
throw new Error("Connection in pub/sub mode, only pub/sub commands may
^
Error: Connection in pub/sub mode, only pub/sub commands may be used
at RedisClient.send_command (/Users/shripadk/NKO/team-unknown/node_modules/redis/index.js:726:15)
at RedisClient.commands.forEach.RedisClient.(anonymous function) (/Users/shripadk/NKO/team-unknown/node_modules/redis/index.js:872:25)
at Timer.<anonymous> (/Users/shripadk/NKO/team-unknown/app.js:40:28)
at Timer.exports.setInterval.timer.ontimeout (timers.js:234:14)
/Users/shripadk/NKO/team-unknown/node_modules/redis/index.js:504
throw callback_err;
^
Error: Auth error: ERR timeout
at Command.RedisClient.do_auth.self.send_anyway [as callback] (/Users/shripadk/NKO/team-unknown/node_modules/redis/index.js:171:43)
at RedisClient.return_error (/Users/shripadk/NKO/team-unknown/node_modules/redis/index.js:500:25)
at ReplyParser.RedisClient.init_parser (/Users/shripadk/NKO/team-unknown/node_modules/redis/index.js:260:14)
at ReplyParser.EventEmitter.emit (events.js:96:17)
at ReplyParser.send_error (/Users/shripadk/NKO/team-unknown/node_modules/redis/lib/parser/javascript.js:293:10)
at ReplyParser.execute (/Users/shripadk/NKO/team-unknown/node_modules/redis/lib/parser/javascript.js:176:22)
➜ team-unknown git:(master) ✗ jitsu databases create redis sentineldb
info: Welcome to Nodejitsu nko3-team-unknown
info: jitsu v0.10.5, node v0.8.14
info: It worked if it ends with Nodejitsu ok
info: Executing command databases create redis sentineldb
info: A new redis has been created
/Users/shripadk/node/lib/node_modules/jitsu/lib/jitsu/commands/databases.js:320
server = database.metadata.label.split('-')[0] + '.redistogo.com';
^
@shripadk
shripadk / gist:4046940
Created November 9, 2012 17:17
working gyp
➜ sigar git:(master) sudo node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@0.7.3
gyp info using node@0.8.14 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/Users/shripadk/.node-gyp/0.8.14/tools/gyp/gyp',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',