Skip to content

Instantly share code, notes, and snippets.

View jrun's full-sized avatar

Jeremy Burks jrun

View GitHub Profile
@jrun
jrun / merge_casts.rb
Last active April 21, 2020 13:29
Quick and dirty script to merge asciicast files
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'json'
require 'pathname'
cast_files = ARGV.map { |cast| Pathname cast }
#
# Merge files

Keybase proof

I hereby claim:

  • I am jrun on github.
  • I am jeremyburks (https://keybase.io/jeremyburks) on keybase.
  • I have a public key ASBHbuig8HCdYOzWQrypVVtNAIi7rU9EBkvtlK5z1-1ZMwo

To claim this, I am signing this object:

@jrun
jrun / pg-query.d
Created September 18, 2012 16:15
Time postgres queries using dtrace - WIP
#!/usr/bin/env dtrace -s
#pragma D option quiet
#pragma D option switchrate=10hz
/*
docs:
http://www.postgresql.org/docs/9.2/interactive/dynamic-trace.html
*/
@jrun
jrun / hijack_stdout.rb
Created March 1, 2012 22:34
Experiment with coloring and filtering stdout for a capistrano+chef project.
#!/usr/bin/env ruby
require 'capistrano/cli'
require 'term/ansicolor'
include Term::ANSIColor
#
# This might get a real CLI at some point
#
puts "Target hosts: %s\nRecipes: %s\n" % [ENV['HOSTS'], ENV['RECIPES']]
@jrun
jrun / guard-multiminitest.rb
Created February 9, 2012 02:29
Hack up guard-minitest to support sub-projects.
require 'guard'
require 'guard/guard'
module Guard
# This MiniTest guard is a hacked up version of guard-minitest
# which supports guards scoped by sub-directories. Think one
# Guardfile at the root of rails which has a minitest guard for
# each (active|action)* project.
#
# ## Example Guardfile
@jrun
jrun / rbtrace
Created February 8, 2012 17:37
Using dtrace, trace method calls for a given, fully qualified module. If a module is not given all method calls are traced.
#!/usr/bin/env ruby
# This script requires the traced Ruby process to be tenderlove's probes
# branch (https://github.com/tenderlove/ruby-1/tree/probes).
fq_module = ARGV[0]
d_script = "ruby*:::function-entry\n"
d_script << "/copyinstr(arg0) == \"#{fq_module}\"/\n" if fq_module
d_script << <<-ACTION
@jrun
jrun / mac_specific.el
Created January 8, 2012 16:13
mac specific emacs configuration
;; key bindings
(when (eq system-type 'darwin) ;; mac specific settings
(setq mac-option-key-is-meta t)
(setq mac-command-key-is-meta nil)
(setq mac-command-modifier 'control)
(global-set-key [kp-delete] 'delete-char) ;; sets fn-delete to be right-delete
)
@jrun
jrun / install-openvpn.sh
Created July 22, 2011 16:47
openvpn Homebrew Formula for OSX Lion
brew install https://raw.github.com/gist/1099830/02960cf13a1486f4c73972b707cd979ea0dfbbec/openvpn.rb --force
@jrun
jrun / .pryrc
Created May 1, 2011 02:22
Modify Pry's wait prompt to look better when using ruby-send-* in emacs
Pry.prompt[1] = proc {""}
@jrun
jrun / dumbfr.rb
Created July 1, 2010 01:09
This sucks. What is the better way?
#!/usr/bin/env ruby
find = ARGV[0]
replace = ARGV[1]
`ack '#{find}' -l`.split.each do |f|
`sed -i 's/#{find}/#{replace}/g' #{f}`
end