Skip to content

Instantly share code, notes, and snippets.


Dotan J. Nahum jondot

View GitHub Profile
View keymap.cson
'cmd-0': 'tree-view:toggle-focus'
'ctrl-h': 'window:focus-pane-on-left'
'ctrl-l': 'window:focus-pane-on-right'
'j j': 'vim-mode:activate-normal-mode'
jondot / reducer.js
Created Oct 29, 2015
A ReducerStore
View reducer.js
class ReducerStore {
static handler(store=new Store, action){
var fn = store[action.type]
return fn(action)
} else {
return store
View gist:6405909
Total Notifications": {
source: "http://localhost:4567/",
refresh_interval: 4000,
GaugeLabel: {
parent: "#hero-one",
title: "Notifications Served",
type: "max"

Debugging & Profiling Node.js

This is a maintained listing of all the different ways to debug and profile Node.js applications. If there is something missing or an improvement, post a comment! :)

Interactive Stack Traces with traceGL - Shareware

  1. Guide here
View gist:5004412
App.Group = Ember.Object.extend()
App.Tile = Ember.Object.extend()
App.Surface = Ember.Object.extend()
find: (id)->
App.Surface.create {
groups: [
App.Group.create {
View Assetfile
require 'rake-pipeline-web-filters'
output "public"
class Rake::Pipeline::DSL::PipelineDSL
def production?
ENV['RAKEP_MODE'] == 'production'
View gist:4183355

Tracking Your Business

You've built (or are maintaining) a product which has many services over different machines at the backend, all orchestrating together to implement one or more business processes. How are you tracking this system?

In general: how can we provide visibility for linear-pipeline distributed systems where a series of processing stages are arranged in succession to perform a specific business function over a data stream (i.e. transaction), and across several machines?

A simple, somewhat crude, example for cross-systems transaction would be an order preparation system in real life, let's say in an electronics factory. During such a workflow, an order entering the processing pipeline goes through each stage defined by the manufacturing floor manager - "planning, provisioning, packing, shipping".

Taking this a bit closer to the Web, we can easily see instances of such transactions, even if we are not always aware we've implemented them that way. A background job is a pipeline, or a transa

View gist:4169817
require 'net/ssh'
Net::SSH.start('localhost', 'jondot', :password => 'foobar') do |ssh|
result = ssh.exec!('ls -l')
puts result
View puppy.rb
module MyLibrary
# nasty static variable
BigBallOfMud = { :woofed => 0 }
class Puppy
def woof!
puts "woof!"
# for book keeping
MyLibrary::BigBallOfMud[:woofed] += 1
View gist:3486823
Could not send message: send: name or service not known
org/jruby/ext/socket/ `send'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/gelf-1.3.2/lib/gelf/ruby_sender.rb:16:in `send_datagrams'
org/jruby/ `each'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/gelf-1.3.2/lib/gelf/ruby_sender.rb:15:in `send_datagrams'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/gelf-1.3.2/lib/gelf/notifier.rb:143:in `notify_with_level!'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/gelf-1.3.2/lib/gelf/notifier.rb:118:in `notify!'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/log4r-gelf-0.9.0/lib/log4r-gelf/gelf_outputter.rb:99:in `canonical_log'
/home/jondot/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/gems/shared/gems/log4r-1.1.10/lib/log4r/outputter/outputter.rb:130:in `synch'