Skip to content

Instantly share code, notes, and snippets.


Jordan Brough jordan-brough

View GitHub Profile
jordan-brough /
Last active August 29, 2015 13:56
Bash compliments when you clear your screen. You deserve it. ;)
# from
# inspired by
function emergency_compliment {
ruby <<RUBY
require "rubygems"
require "json"
today ='%Y-%m-%d')
today_filename = "/tmp/compliments-#{today}.json"
latest_filename = "/tmp/compliments-latest.json"
json = if File.exist?(today_filename)
jordan-brough /
Last active August 29, 2015 14:05
customized spree sandbox
#!/usr/bin/env bash
set -e
cd ~/repos/spree
bundle install --quiet 1> /dev/null || bundle update --quiet
bundle exec rake sandbox
jordan-brough / parallel_processor.rb
Last active August 29, 2015 14:06
Ruby parellel processing and inter-process messaging with fork
View parallel_processor.rb
class ParallelProcessor
attr_accessor :pid_params
def initialize
@pid_params = {}
def spawn_worker(start, finish, writer)
pid = fork do
puts "worker working on #{start} to #{finish}"
jordan-brough / gist:1684779
Created January 26, 2012 20:07
Decode Rails session cookie
View gist:1684779
cookie = 'XXX--YYY'
View github_dashboard_twitter.user.js
// ==UserScript==
// @name GitHub Dashboard Twitter
// @namespace
// @include
// ==/UserScript==
$(" h1").before(
$("<div>").attr("id", "twitter_div2").append(
$("<h1>").text("GitHub status ").css({
jordan-brough / gist:3452180
Created August 24, 2012 15:48
Extend splunk saved search TTL to 1 year
View gist:3452180
# 31536000 == 1 year (365 days) in seconds
curl -u <USERNAME>:<PASSWORD> --insecure https://<SPLUNK_URL>:8089/services/search/jobs/<JOB_ID>/control -d action=setttl -d ttl=31536000; echo
jordan-brough / Git branch bash autocomplete *with aliases*
Created April 26, 2018 13:07 — forked from JuggoPop/Git branch bash autocomplete *with aliases*
Git branch bash autocomplete *with aliases* (add to .bash_profile)
View Git branch bash autocomplete *with aliases*
# To Setup:
# 1) Save the .git-completion.bash file found here:
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
# Git branch bash completion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Add git completion to aliases
jordan-brough / DefaultKeyBinding.dict
Last active July 11, 2018 18:27
MacOS checkmark keybinding
View DefaultKeyBinding.dict
// Installation:
// 1. Save this file as /Users/YOUR_USER_NAME_HERE/Library/KeyBindings/DefaultKeyBinding.dict
// 2. Log out and log back in (or just restart any app where you'd like to use the shortcut)
// What: Keyboard shortcut to easily insert checkmarks. (Or whatever text you'd like to insert).
// By default option+v in MacOS inserts a square-root symbol: √
// I've often used option+v as a quick-and-dirty checkmark. This shortcut lets me get a real checkmark.
// Insert a checkmark with option+v
jordan-brough / instructions.markdown
Created November 3, 2012 13:50
Splunk-friendly timestamp plugin snippet for Sublime Text 2
View instructions.markdown
  1. Choose: Tools > New Plugin

  2. Paste in the contents of "" below

  3. Save as in ~/Library/Application Support/Sublime Text 2/Packages/User/ (should be the default directory that pops up when you save)

  4. Choose: Sublime Text 2 > Preferences > Key Bindings - User

  5. Add:

    { "keys": ["super+ctrl+t"], "command": "timestamp" }

To make command+ctrl+t perform the insertion.
Make sure to add a comma after the previous keymap entry, if present.