Skip to content

Instantly share code, notes, and snippets.

@davidmyersdev
Last active March 26, 2020 14:43
Show Gist options
  • Save davidmyersdev/5b2f3c2dff362d704d06f64489480e4c to your computer and use it in GitHub Desktop.
Save davidmyersdev/5b2f3c2dff362d704d06f64489480e4c to your computer and use it in GitHub Desktop.
Random code snippets
# generate a Rails migration timestamp
Time.now.strftime('%Y%m%d%H%M%S')
# schedule automatic postgres backups in heroku
heroku pg:backups:schedule DATABASE_URL --at '02:00 America/New_York' --app <app>
# repeat a command n times
for i in {1..5}; do echo 'hello'; done
# generate a human readable timestamp
date -r `date +%s`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment