Skip to content

Instantly share code, notes, and snippets.

@matt-hwy1
matt-hwy1 / gist:5009959
Created February 22, 2013 01:03
bundle update only a single gem
bundle update --source <gemname>
@matt-hwy1
matt-hwy1 / gist:5257009
Created March 27, 2013 18:55
If you ever want to round a time to the nearest 15 minutes
Time.zone.at((Time.parse("1:43am").to_f/(15.minutes)).round * 15.minutes)
@matt-hwy1
matt-hwy1 / gist:5379493
Created April 13, 2013 18:24
How to review local commits that haven't been pushed.
git log origin/master..HEAD
You can also view the diff using the same syntax
git diff origin/master..HEAD
@matt-hwy1
matt-hwy1 / gist:7016957
Created October 16, 2013 23:47
Push local branch to staging
git push staging yourbranch:master
@matt-hwy1
matt-hwy1 / gist:8058426
Last active December 31, 2015 23:09
YAML from text file
--- !ruby/object:Delayed::PerformableMethod
object: !ruby/ActiveRecord:ScantronFile
attributes:
id: 64
data: "3030335aa 301000001001121013001 5381 1 N 0000253755 BGFAEB
\ ABDAA BCCDDDDDEDDCDDDBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCAAAABAAAAAAAAAAAAAAAAAAAAAAABBBBAA
\ AAAAAAAAABBBDCCAADBDDDDDDDDABAB \r\n3030335aa
\ 301000002001121013001 5381 1 N 0000253756 BGHAFBFA AEGD
\ A DCCEECCDDBCCCCCBBBAAAFAAA
@matt-hwy1
matt-hwy1 / gist:8058615
Created December 20, 2013 17:49
Raw text
1530021AA 301000001001112013001 5381 1 N 0000364276 BAACDED AA A ACDBAA A BACBDEABACCBACAACBDCDBEABCCBACDABACABDEDBAADADBADEDCBAAAABCDDCCEECBACECCCBAAABAABCDECABCBDEDCBACDBAAA A ABABDEDCCBACDCBACDCBACBBBACAAE
1530021AA 301000002001112013001 5381 1 N 0000364277 BBBADCEAA AA CABDAAAA AABDEEECBCCDEACBDEDECBCAECBABAACDEDEABACBDECADCABACECBECACBDBAEEBBBCCCAABBBDEABCBDAEAC?BBAADDECBACA A A CDEBBCAACDBBCAEDABCADECADCBADE
1530021AA 301000003001112013001 5381 1 N 0000364279 DAABEEBA AA CEAEA AA
http://stackoverflow.com/questions/808547/fully-custom-validation-error-message-with-rails
%h1
%span
= @pq_organization.name