Personal collection of commands and snippets that just won't stay in my head.
Last active
August 29, 2015 14:05
-
-
Save timstott/c1f6e9ac57011a1213b8 to your computer and use it in GitHub Desktop.
cheatsheets
git branch | grep '3\.2' | xargs git branch -d
git push heroku develop:master
git-flow epic infographic
Usefull to identify if multiple certificates have been signed with the same key.
openssl x509 -noout -modulus -in certificate.crt | openssl md5
openssl rsa -noout -modulus -in privateKey.key | openssl md5
openssl req -noout -modulus -in CSR.csr | openssl md5
openssl x509 -noout -in certificate.crt -dates
rvm --ruby-version use 1.9.3@gemset-name
rvm gemset list_all
gem list --local
Handy on legacy projects using ancient versions of rubygems.
rvm rubygems remove
Hash[ hash.map { |k,v| ["#{k}_something", v ] } ]
Time.now.strftime('%Y/%m/%d')
=> "2014/08/11"
# Fetch data
a = User.active.map { |u| [u.name, u.email] }
# Transform data to CSV
csv = a.map { |e| e.join(', ') }.join("\n")
# Write to file
File.open("users.csv", "w") { |f| f.write(csv) }
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment