Skip to content

Instantly share code, notes, and snippets.

View jyurek's full-sized avatar

Jon Yurek jyurek

View GitHub Profile
group :first do
gem "activerecord", "2.0.5"
end
group :second do
gem "activerecord", "2.3.5"
end
group :third do
gem "activerecord", "3.0.0.rc2"
@jyurek
jyurek / tempify.rb
Created July 14, 2010 13:25
Make any File a temporary file
require 'fileutils'
class File
def self.finalizer(path)
lambda do
FileUtils.rm(path)
end
end
def tempify!
@jyurek
jyurek / .bashrc
Created May 19, 2011 19:17
A bash prompt with useful information, including popping up a growl notification when commands are done.
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo '✏ '
}
function parse_git_branch {
git branch --no-color 2> /dev/null | grep \* | awk '{print $2}'
}
function parse_hg_branch {
hg branch 2>/dev/null
require 'rubygems'
require 'benchmark'
require 'dimensions'
pics = Dir.glob("/Users/jyurek/Pictures/[0-9a-zA-Z]*.*")
Benchmark.bmbm do |x|
x.report('imagemagick') do
pics[0..1000].each{|f| `identify -format '%wx%h' "#{f}" 2>&1`.split("x") }
end
x.report('dimensions') do
@jyurek
jyurek / gist:2595139
Created May 4, 2012 14:33
rbenv doesn't work for me.
1 Birdhouse:~/Development/project1 jyurek (sandbox1)$ which bundle
/Users/jyurek/.rbenv/shims/bundle
0 Birdhouse:~/Development/project1 jyurek (sandbox1)$ bundle
Fetching source index for http://rubygems.org/
Enter your password to install the bundled RubyGems to your system: #[ <-------- WAT ]
[.. a bunch of gems ...]
Installing linecache19 (0.5.12) /Library/Ruby/Site/1.8/rubygems/installer.rb:388:in `ensure_required_ruby_version_met': linecache19 requires Ruby version >= 1.9.2. (Gem::InstallError)
from /Library/Ruby/Site/1.8/rubygems/installer.rb:156:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:101:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
@jyurek
jyurek / recipe
Created January 30, 2013 15:38
Chicken Paprikash
1 cup onion, diced
3/4 stick butter
2 tsp salt
4 tsp bullion
6 cups water
3 tbsp paprika
4lbs chicken thighs
7 tbsp flour
1 cup plain yogurt (or sour cream, but yogurt is smoother in the end)
irb(main):001:0> "hello"f.object_id
=> 70108391341300
irb(main):002:0> "hello"f.object_id
=> 70108391341300
@jyurek
jyurek / lt
Created October 7, 2013 14:53
Useful command for getting large type
#!/usr/bin/osascript
on run argv
set display_string to (item 1 of argv)
tell application "Quicksilver" to show large type display_string
end run
[26] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_20>)> MIME::Types["text/plain"].first.extensions
=> ["doc"]

Keybase proof

I hereby claim:

  • I am jyurek on github.
  • I am jyurek (https://keybase.io/jyurek) on keybase.
  • I have a public key whose fingerprint is FB6F B8E3 DB7F 794D FCB2 3360 5E88 9106 71F7 F337

To claim this, I am signing this object: