Skip to content

Instantly share code, notes, and snippets.

Adam Roben aroben

Block or report user

Report or block aroben

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

If you add the following CSS rule:

details > details {
  padding-left: 20px;

The following markup becomes a nested outline view:

aroben / stackprof-to-flamegraph
Created Mar 6, 2017
Script to generate flamegraphs from Ruby stackprof profiles
View stackprof-to-flamegraph
# First generate a profile using
# true, out: "tmp/stackprof.dump) { something_expensive }
# Then run this script
# $ stackprof-to-flamegraph tmp/stackprof.dump
set -e
if [ "$STACKCOLLAPSE" = "1" ]; then
aroben / git-commit-editor.vim
Last active Oct 31, 2019
Vim script to show git commit diff in vertical split while writing commit messages
View git-commit-editor.vim
" Put this in your .vimrc and whenever you `git commit` you'll see the diff of your commit next to your commit message.
" For the most accurate diffs, use `git config --global commit.verbose true`
" BufRead seems more appropriate here but for some reason the final `wincmd p` doesn't work if we do that.
autocmd VimEnter COMMIT_EDITMSG call OpenCommitMessageDiff()
function OpenCommitMessageDiff()
" Save the contents of the z register
let old_z = getreg("z")
let old_z_type = getregtype("z")
aroben / 01_process_stats.rb
Last active Nov 7, 2016
sketch of a ProcessUtilization rework
View 01_process_stats.rb
class ProcessStats
include Singleton
def add_source(source)
@sources << source
def snapshot
aroben /
Last active Sep 23, 2016
ruby array length vs. capacity
aroben / license.diff
Last active Aug 29, 2015
Patch to add a license to Genshi.tmbundle
View license.diff
Index: textmate/Genshi.tmbundle/COPYING
--- textmate/Genshi.tmbundle/COPYING (revision 0)
+++ textmate/Genshi.tmbundle/COPYING (working copy)
@@ -0,0 +1,28 @@
+Copyright (C) 2014 Edgewall Software
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
aroben /
Created Nov 12, 2014
Find most common Hubot commands from Campfire
set -e
curl -s -u $CAMPFIRE_TOKEN:X https://$$CAMPFIRE_ROOM/transcript.json | jq -r '.messages | .[] | select(.body != null) | .body | select(startswith("/"))' | cut -d' ' -f1 | sort | uniq -c | sort -rn
aroben / hissuegram.rb
Last active Aug 29, 2015
Script to generate a histogram of GitHub issue age
View hissuegram.rb
#!/usr/bin/env ruby
# Usage: GITHUB_TOKEN=yourtoken hissuegram.rb owner/repo
require "octokit"
client = => ENV["GITHUB_TOKEN"], :auto_paginate => true)
issues = client.issues ARGV[0], :state => :open
dates = { |i| i["created_at"] }
aroben / index.html
Last active Aug 29, 2015
Test which Unicode code points are rendered as emoji on your system
View index.html
<!DOCTYPE html>
body {
font-family: monospace, "Segoe UI Emoji";
aroben / deleters.js
Last active Aug 29, 2015
Find who has deleted more code than they've added; run on or similar
View deleters.js
$.makeArray($('.capped-card')).map(function(e) {
return [$(e).find('.aname').text(), parseInt($(e).find('.a').text().replace(/,/g, ''), 10), parseInt($(e).find('.d').text().replace(/,/g, ''), 10)];
}).filter(function(a) {
return a[2] > a[1];
}).map(function(a) {
return [a[0], a[2] - a[1], a[2] / a[1]];
}).sort(function(a, b) {
return b[1] - a[1];
}).map(function(a) {
return a[0] + " removed " + a[1] + " lines (" + a[2].toFixed(2) + "x as many lines as they added)";
You can’t perform that action at this time.