Skip to content

Instantly share code, notes, and snippets.

View shripadk's full-sized avatar
🎯
Working

Shripad Krishna shripadk

🎯
Working
View GitHub Profile
@shripadk
shripadk / gist:562270
Created September 2, 2010 13:16
Google Closure XPC demo
goog.require('goog.Uri');
goog.require('goog.events');
goog.require('goog.json');
goog.require('goog.net.xpc.CrossPageChannel');
goog.global.initOuter = function(url) {
goog.events.listen(window, 'load', function() { xpcdemo.initOuter(url); });
};
goog.global.initInner = function() {
goog.events.listen(window, 'load', function() { xpcdemo.initInner(); });
01000000010518d85ccd785c2b8272040e9d8af81525444d039b8970fc02c42475c660e1a400000000d700483045022100cc31a4757fb8c271d904f76a09f49e65699804a4b32879a61cd8cc4cada3078202205e0e1110e6dd066562c190b69c09f6b55dccbb85218e7dbeb87dc04013a81206014c8b5121034ccea3bd0a30e05d9065e4a47683ff86c2b735bc24b5abf682c9421563ea764d21024aa0ff5b42d9e4694b6092183952592f657b71f221120ce522fcdc265038ec6b2102f0a18afb3a68d3329bbee1f154bcf4f29aec0185974ec803ac767a259da764e521020b2af507a116fa025f286004c2704004205a5aff5b4dba99fd08ac24ac300cf254aeffffffff01a0860100000000001976a914d8c446e59afac7863e4698f6d4de9d7a45fbd76988ac00000000
var redis = require('redis');
var client = redis.createClient();
var pullNotifications = function() {
// if notification in list rpop it else block until one is available; timeout=0;
client.brpop('_bitcoin_notifications_', '_bitcoin_notifications_', 0, function(e, data) {
if(!data.length) return;
data = JSON.parse(data[1]);
switch(data.type) {
# 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 / MenuServicos.jsx
Created December 10, 2015 17:08 — forked from LuizMoreira/MenuServicos.jsx
[Rubix] - Menu item - I can't load menu item dynamically.
var ReactIntl = require('react-intl');
var IntlMixin = ReactIntl.IntlMixin;
var FormattedNumber = ReactIntl.FormattedNumber;
var MenuServicos = React.createClass({
mixins: [IntlMixin],
render: function() {
var menu = (
@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