Skip to content

Instantly share code, notes, and snippets.

@ang3lkar
Last active August 29, 2015 13:58
Show Gist options
  • Save ang3lkar/9971571 to your computer and use it in GitHub Desktop.
Save ang3lkar/9971571 to your computer and use it in GitHub Desktop.
Various snippets
# RUN MULTIPLE SERVERS LOCALLY
rails s
rails s -p 3001 -P tmp/pids/server2.pid
# RUN A SPECIFIC METHOD IN A MINITEST CLASS
ruby -Ilib:test test/models/widget_test.rb -n test_refresh
# PRETTY LOOP PRINT
Encoding.list.each{|enc|
begin
print "%-10s\t" % [enc]
print "\t\xD0".force_encoding(enc)
print "\t\xD0".force_encoding(enc).encode('utf-8')
rescue => err
print "\t#{err}"
end
print "\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment