Skip to content

Instantly share code, notes, and snippets.

@jondot
jondot / keybez.md
Created January 14, 2016 16:49
ios keyboard bezier
  onKeyboardWillHide(e) {
    Animated.timing(this.state.height, {
      toValue: this.listViewMaxHeight,
      duration: e.duration,
      easing: Easing.bezier(0.1, 0.76, 0.55, 0.9)
    }).start();
  },

 onKeyboardWillShow(e) {
'.platform-darwin':
'cmd-0': 'tree-view:toggle-focus'
'atom-text-editor.vim-mode.normal-mode':
'ctrl-h': 'window:focus-pane-on-left'
'ctrl-l': 'window:focus-pane-on-right'
'atom-text-editor.vim-mode.insert-mode':
'j j': 'vim-mode:activate-normal-mode'
@jondot
jondot / reducer.js
Created October 29, 2015 19:10
A ReducerStore
class ReducerStore {
static handler(store=new Store, action){
var fn = store[action.type]
if(fn){
return fn(action)
} else {
return store
}
}
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
App.Group = Ember.Object.extend()
App.Tile = Ember.Object.extend()
App.Surface = Ember.Object.extend()
App.Surface.reopenClass
find: (id)->
App.Surface.create {
groups: [
App.Group.create {
@jondot
jondot / Assetfile
Created January 11, 2013 11:14
Assetfile
require 'rake-pipeline-web-filters'
output "public"
class Rake::Pipeline::DSL::PipelineDSL
def production?
ENV['RAKEP_MODE'] == 'production'
end
end

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

require 'net/ssh'
Net::SSH.start('localhost', 'jondot', :password => 'foobar') do |ssh|
result = ssh.exec!('ls -l')
puts result
end
module MyLibrary
# nasty static variable
BigBallOfMud = { :woofed => 0 }
end
class Puppy
def woof!
puts "woof!"
# for book keeping
MyLibrary::BigBallOfMud[:woofed] += 1