Skip to content

Instantly share code, notes, and snippets.


Justin Rainbow justinrainbow

View GitHub Profile
View gist:512071fdf74fd4bcefe1d8a24572cb3b
### Keybase proof
I hereby claim:
* I am justinrainbow on github.
* I am justinrainbow ( on keybase.
* I have a public key ASAyl1QWmXnM04A-VtPfv2nMTgJeTj1pSVMB-KY1fUsK-Ao
To claim this, I am signing this object:
justinrainbow / spec-builder.php
Created Feb 20, 2014
Create PhpSpec base specs from existing code
View spec-builder.php
require_once 'vendor/autoload.php';
$class = $argv[1];
$class = str_replace('/', '\\', $class);
$refl = new ReflectionClass($class);
View mysql_db_slow
#!/usr/sbin/dtrace -s
* mysql_db_slow.d Trace queries slower than specified ns.
* USAGE: ./mysql_db_slow.d min_ns
#pragma D option quiet
#pragma D option defaultargs
#pragma D option switchrate=10hz
View Preferences.sublime-settings
"bold_folder_labels": true,
"ensure_newline_at_eof_on_save": true,
"font_size": 12.0,
"highlight_modified_tabs": true,
justinrainbow / gist:7663199
Created Nov 26, 2013
clean out old screen sessions
View gist:7663199
ls -t /tmp/uscreens/S-$USER | awk -F '.' 'NR > 1 { print $1 }' | xargs -I {} screen -S {} -X quit
View .gitconfig
whitespace = nowarn
co = checkout
stage = add
unstage = reset HEAD
plog = log --pretty=format:\"%h %Cblue%cr%Creset %cn %Cgreen%s%Creset\"
st = status
ci = commit
justinrainbow / gist:4627684
Created Jan 24, 2013
my sublime text 2 config
View gist:4627684
"bold_folder_labels": true,
"color_scheme": "Packages/User/Monokai Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 12.0,
justinrainbow /
Last active May 20, 2017
Simple bootstrap script for getting RabbitMQ w/ the Stomp plugin and web management plugin running on a SmartOS box
pkgin -y in rabbitmq
rabbitmq-plugins enable rabbitmq_stomp rabbitmq_management
cat > /opt/local/etc/rabbitmq/rabbitmq-env.conf <<-EOF
View gist:4121808
function DataSourceQueue(config) {
// console.log(config, Y.DataSource.Local.transactions);
this._ds =;
this.transactions = [];
this._ds.after('request', this.add, this);
this._ds.on('response', function(e) {
console.log('DS response', e.tId);
justinrainbow /
Created Sep 5, 2012 — forked from jverdeyen/
Sublime Text 2 PHP Getter Setter Generator
import sublime, sublime_plugin, re, os
# check indention (spaces/tabs/size, current indention )
# insert right where the pointer is, or insert right before the closing } of the class?
# check of these generator getter/setters already exist? make it idempotent?
class GeneratorCommand(sublime_plugin.TextCommand):
def fixup(self, string):