Skip to content

Instantly share code, notes, and snippets.

View cmhobbs's full-sized avatar
🍩
Waiting between the walls.

Christopher M. Hobbs cmhobbs

🍩
Waiting between the walls.
View GitHub Profile
hobbsc@haqnode:~/dev/j$ sqlite3 ~/j.db
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from entrieses;
1|2010-09-10T22:40:46+00:00|test message||
2|2010-10-10T21:58:39+00:00|new message||
sqlite> select * from laundry_lists;
1|milk, eggs, butter|0
sqlite>
filetype plugin on
filetype indent on
set t_Co=256
syntax on
colorscheme obsidian
set number
set expandtab
set shiftwidth=2
@cmhobbs
cmhobbs / cents.rb
Created November 12, 2010 15:35
duck punchin' #to_cents method and some tests
class String
def to_cents
regex = /[\,$]/
if self.match(regex)
self.gsub!(regex, "")
end
if self.match(/\./)
dollars, change = self.split(".")
(dollars + change).to_i
# convenience file for testing ActiveMerchant objects in
# IRB. See billing module and/or ActiveMerchant docs
# for creating a gateway and commiting a charge.
require 'rubygems'
require 'active_support/all'
require 'active_merchant'
include ActiveMerchant::Billing
ActiveMerchant::Billing::Base.mode = :test
setenforce 0
ruby-1.9.2-p0 > m.screen.window.clear
=>
ruby-1.9.2-p0 > m.keyboard << "save\n"
=> "save\n"
ruby-1.9.2-p0 > m.run
Z::RuntimeError: Error running program: z_save is not yet implemented!
from /home/chobbs/.rvm/gems/ruby-1.9.2-p0/gems/dorothy-0.0.0/lib/dorothy/machine.rb:8:in `step'
from /home/chobbs/.rvm/gems/ruby-1.9.2-p0/gems/dorothy-0.0.0/lib/dorothy/machine.rb:8:in `block in run'
from /home/chobbs/.rvm/gems/ruby-1.9.2-p0/gems/dorothy-0.0.0/lib/dorothy/machine.rb:7:in `loop'
from /home/chobbs/.rvm/gems/ruby-1.9.2-p0/gems/dorothy-0.0.0/lib/dorothy/machine.rb:7:in `run'
[05:21][hobbsc@arrakis:~/dev/billing(codereview)]$ bundle install
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/ui.rb:56:in `<class:UI>': uninitialized constant Gem::SilentUI (NameError)
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/ui.rb:2:in `<module:Bundler>'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/ui.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/cli.rb:16:in `initialize'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/vendor/thor.rb:246:in `new'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/bin/bundle:13:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p136/b
@cmhobbs
cmhobbs / wtf
Created February 2, 2011 05:40
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.1/lib/active_support/core_ext/module/remove_method.rb:3 - method `_ssl_strict' not defined in Class
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.1/lib/active_support/core_ext/module/remove_method.rb:3 - method `_ssl_strict' not defined in ActiveMerchant::Billing::Gateway
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.1/lib/active_support/core_ext/module/remove_method.rb:3 - method `_open_timeout' not defined in Class
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.1/lib/active_support/core_ext/module/remove_method.rb:3 - method `_open_timeout' not defined in ActiveMerchant::Billing::Gateway
Exception `NameError' at /usr/local/rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.1/lib/active_support/core_ext/module/remove_method.rb:3 - method `_read_timeout' not defined in Class
Exception `NameError' at /usr/local/rvm/gems
@cmhobbs
cmhobbs / kvminst.sh
Created March 18, 2011 01:17
hack script to install/setup kvm
#!/usr/bin/env bash
# Quick and dirty KVM setup script.
cat << EOT
THIS SCRIPT SHOULD GET YOU UP AND RUNNING WITH KVM.
HERE'S THE PROCESS:
- UPDATE YOUR SYSTEM
- INSTALL KVM'S REQUIRED PACKAGES
- ADD YOUR USER TO THE NECESSARY GROUPS
Installing RVM to /usr/local/rvm/mv: cannot stat `config/user': No such file or directory
touch: cannot touch `user/db': No such file or directory
touch: cannot touch `user/rvmrcs': No such file or directory