Skip to content

Instantly share code, notes, and snippets.

@mrjabba
mrjabba / r-all.bash
Created August 11, 2011 00:35
rebase all bash
function r-all {
cd /branch/foo
pwd -P
echo "Rebasing branch..."
./rebase.sh;
notify-send "Done rebasing branch..."
cd /trunk/foo
echo "Rebasing trunk..."
pwd -P
@mrjabba
mrjabba / .gitconfig
Created August 28, 2011 20:04
git instaweb config for Chrome in Ubuntu
[browser "chrome"]
cmd = /usr/bin/google-chrome
[instaweb]
httpd=webrick
browser=chrome
@mrjabba
mrjabba / cider.markdown
Created September 10, 2011 22:26
Rubus Primus Cider

##Rubus Primus Cider

###Liquid 4 Gallons Tree Top, liquid

###Sugars

  • 1 lb cane sugar dissolved in water

###Adjuncts

  • 2 fl oz Raspberry flavoring
@mrjabba
mrjabba / git_branching.txt
Created October 27, 2011 14:47
Git branching with multiple defects when you can't commit back to SVN
-- Working on multiple defects when can't dcommit back to SVN for a few dayes.
from updated master
git checkout master...new defecta branch
do work/local commit
rebase master to stay current
git checkout master...new defectb branch
merge defect a branch to defectb branch
do work/local commit
rebase master to stay current
git checkout master...new defectc branch
@mrjabba
mrjabba / pacman.conf
Created February 26, 2012 21:08
pacman.conf
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
@mrjabba
mrjabba / rc.conf
Created February 26, 2012 21:09
rc.conf
#
# /etc/rc.conf - Main Configuration for Arch Linux
#
# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# DAEMON_LOCALE: If set to 'yes', use $LOCALE as the locale during daemon
@mrjabba
mrjabba / makepkg.conf
Created February 26, 2012 22:01
makepkg.conf
#
# /etc/makepkg.conf
#
#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
# Format: 'protocol::agent'
@mrjabba
mrjabba / rack_simple.rb
Created May 12, 2012 17:14
Creating the simplest possible server in ruby using rack
my_rack_proc = lambda { |env| [200, {"Content-Type" => "text/plain"}, ["Hello. The time is #{Time.now}"]] }
puts my_rack_proc.call({})
require 'rack'
Rack::Handler::WEBrick.run(my_rack_proc, :Port => 3000)
@mrjabba
mrjabba / newScheduledThreadPool_jruby.rb
Created July 11, 2012 20:33
how to schedule a newScheduledThreadPool in jruby
require 'java'
java_import 'java.util.concurrent.Executors'
java_import 'java.util.concurrent.TimeUnit'
class SomeClass
include java.lang.Runnable
def run
puts "imma lil jruby runner"
end
end
@mrjabba
mrjabba / consumer.rb
Created July 20, 2012 17:08
rabbit consumer testing
class BaseMessageHandler
def initialize(opts = {})
@connection_string = opts[:rabbit_mq_host]
raise ConfigurationError.new('rabbit_mq_host is not specified') unless @connection_string
end
def fetch_channel
AMQP.start(@connection_string) do |connection, open_ok|
AMQP::Channel.new(connection) do |channel|
yield channel