Skip to content

Instantly share code, notes, and snippets.

View wenbing's full-sized avatar

wenbing wenbing

View GitHub Profile
@wenbing
wenbing / perf-flame-graph-notes.md
Last active August 29, 2015 14:26 — forked from trevnorris/perf-flame-graph-notes.md
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
importPackage(java.io);
(function(args) {
var templateFileExtension = 'handlebars',
output = ['// This file is auto-generated and should be ignored from version control.\n'],
console = {
log: print
},
showUsage = function() {
console.log('Usage: java -jar <rhino.jar> rhino-handlebars-compiler.js --handlebars <handlebars library path> --templates <templates directory> --output <output file>');
@wenbing
wenbing / nginx.rb
Last active January 3, 2016 20:48 — forked from lepture/nginx.rb
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.4.4.tar.gz'
devel do
url 'http://nginx.org/download/nginx-1.5.8.tar.gz'
end
@wenbing
wenbing / README.md
Created January 9, 2014 12:14 — forked from mbostock/.block

From Wikipedia:

Epicyclic gearing or planetary gearing is a gear system consisting of one or more outer gears, or planet gears, revolving about a central, or sun gear. … Epicyclic gearing systems also incorporate the use of an outer ring gear or annulus, which meshes with the planet gears.

Use the menu in the top-left to change the frame of reference, fixing the specified gear in-place.

package com.linkedin.dust.renderer;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Writer;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.JavaScriptException;
@wenbing
wenbing / pid.js
Created November 21, 2013 01:51 — forked from FGRibreau/pid.js
//
// Usage: require('./pid')("myapp");
//
var fs = require('fs');
module.exports = function(appname){
process.title = appname;
var PID_FILE = "/usr/local/var/run/"+process.title+".pid";
@wenbing
wenbing / .tmux.conf
Created January 10, 2012 15:13 — forked from rdegges/.tmux.conf
My tmux configuration file.
set -g prefix C-a
unbind %
bind \ split-window -h
bind - split-window -v
bind-key k select-pane -U
bind-key j select-pane -D
bind-key h select-pane -L
bind-key l select-pane -R
@wenbing
wenbing / 12306.user.js
Created January 5, 2012 13:39 — forked from quietlynn/12306.user.js
12306 Auto Query => A javascript snippet to help you book ticket
/*
12306 Auto Query => A javascript snippet to help you book tickets online.
Copyright (C) 2011 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js