Skip to content

Instantly share code, notes, and snippets.

View jmazzi's full-sized avatar

Justin Mazzi jmazzi

View GitHub Profile
#!/usr/bin/env ruby
voices = [
"agnes", "kathy", "princess", "vicki", "victoria", "bruce", "fred",
"junior", "ralph", "albert", "bad", "bahh", "bells", "boing",
"bubbles", "cellos", "deranged", "good", "hysterical", "pipe",
"trinoids", "whisper"
]
msgs = [
@jmazzi
jmazzi / ffcurl.rb
Created October 16, 2010 04:06 — forked from mnutt/ffcurl.rb
#!/usr/bin/env ruby
# ffcurl
#
# This curl that automatically uses your firefox cookies. Use it like you would normally
# use curl. Report bugs to [email protected]. Or better yet, fork it from:
#
# http://gist.github.com/393140
#
# Also for webkit/safari: http://gist.github.com/393141
@jmazzi
jmazzi / sfcurl.rb
Created October 16, 2010 04:07 — forked from mnutt/sfcurl.rb
#!/usr/bin/env ruby
# sfcurl
#
# This curl that automatically uses your safari/webkit cookies. Use it like you would
# normally use curl. Report bugs to [email protected]. Or better yet, fork it from:
#
# http://gist.github.com/gists/393141
#
# Also for firefox: http://gist.github.com/393140
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title Passenger memory stats
graph_vlabel count
memory.label memory
END
~/projects/jruby ➔ ls lib/ruby/gems/1.8/gems/ | wc -l
471
~/projects/jruby ➔ time jruby -rubygems -e 1
real 0m5.079s
user 0m7.375s
sys 0m0.393s
~/projects/jruby ➔ git stash pop --quiet
@jmazzi
jmazzi / gist:793544
Created January 24, 2011 17:15 — forked from luk-/gist:792961
root@huckleberry [~]# vim --version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 9 2010 18:43:42)
Included patches: 1, 3-4, 7-9, 11, 13-17, 19-26, 29-31, 34-44, 47, 50-56, 58-64, 66-73, 75, 77-92, 94-107, 109, 202, 234-237
Modified by <[email protected]>
Compiled by <[email protected]>
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
@jmazzi
jmazzi / gist:981240
Created May 19, 2011 17:07 — forked from sdeming/gist:981231
spec_helper.rb, patch for using transactions with Sequel
class Spec::Example::ExampleGroup
def execute(*args, &block)
DB.transaction do
begin
super(*args, &block);
ensure
raise Sequel::Error::Rollback
end
end
end
~ ➔ ruby -rpsych -ryaml -e 'YAML.load("[:year]")'
/Users/headius/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/psych.rb:148:in `parse': couldn't parse YAML at line 1 column 0 (Psych::SyntaxError)
from /Users/headius/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'
from /Users/headius/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/psych.rb:119:in `parse'
from /Users/headius/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/psych.rb:106:in `load'
from -e:1:in `<main>'
~ ➔ ruby -ryaml -e 'YAML.load("[:year]")'
required = [
:i,
:city,
:region,
:postal,
:country,
:license_key
]
optional = [