Show records created in the last 5 hours (requires squeel and activesupport):
Model.where{created_at > 5.hours.ago}.map(&:name)
# secure alphanumeric password generation in a bash function | |
# moved to https://github.com/qrohlf/dotfiles/blob/master/functions/gimmepassword.sh |
Show records created in the last 5 hours (requires squeel and activesupport):
Model.where{created_at > 5.hours.ago}.map(&:name)
#example PR checkout: | |
git remote add bwhthd [email protected]:bwhthd/hackathon-starter-sinatra.git | |
git fetch bwhthd | |
git branch bwhthd-password-reset bwhthd/password_reset | |
git checkout bwhthd-password-reset |
Scout Realtime Install
#0. Install gem on server:
gem install scout_realtime
scout_realtime start
hemingway.qrohlf.com:5555 works now!
### Keybase proof | |
I hereby claim: | |
* I am qrohlf on github. | |
* I am qrohlf (https://keybase.io/qrohlf) on keybase. | |
* I have a public key whose fingerprint is 41EC FE6D 9FFB 8E10 54BE A50E 5D04 7948 81A1 B64B | |
To claim this, I am signing this object: |
ssh-keygen -R hostname.com |
ruby "2.1.1" | |
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'sqlite3' | |
gem 'shotgun' |
#!/usr/bin/env ruby | |
# Read the file into a string | |
file_contents = File.read('memes.txt') | |
# Split those lines into an array | |
lines = file_contents.split("\n") | |
# You could also do the same thing in one step with File.readlines, | |
# but note that File.readlines will keep newlines whereas split strips them |