Skip to content

Instantly share code, notes, and snippets.

View wenbing's full-sized avatar

wenbing wenbing

View GitHub Profile
teset
===
@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
<!doctype html><html data-reactid=".1822ew7vx1c" data-react-checksum="-319125888"><span data-reactid=".1822ew7vx1c.0">COUNT: </span><span data-reactid=".1822ew7vx1c.1">0</span><script src="/wenbing/raw/d2faa982fc2bdf2a9c0c/index.js" data-reactid=".1822ew7vx1c.2:$__appPath"></script><script data-reactid=".1822ew7vx1c.2:$__bootstrap">require('index')({"__appPath":"/wenbing/raw/d2faa982fc2bdf2a9c0c/index.js","count":0,"__appName":"index"});</script></html>
@wenbing
wenbing / index.js
Created November 15, 2014 04:51
requirebin sketch
var b = require('browserify');
console.log(b);
@wenbing
wenbing / index.js
Last active August 29, 2015 14:09
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
function eval(str, context, expose) {
var exposeKeys = [];
var exposeValues = [];
var i;
for (i in expose) {
if (Object.hasOwnProperty.call(expose, i)) {
exposeKeys.push(i);
exposeValues.push(expose[i]);
}
}
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.