Cheatography
https://cheatography.com
Rails
rails server [-b $IP -p $PORT] |
start server |
rails generate scaffold table column:type ... |
rails [version] new name |
create new rails app |
bundle install |
install gems in Gemfile. updates Gemfile.lock |
bundle exec command |
run command with gems from Gemfile.lock |
bundle update |
update list of gems |
rails console |
opens up access to models |
----- Rails Shortcuts ---- |
rails server |
rails s |
rails console |
rails c |
rails generate |
rails g |
bundle install |
bundle |
rake test |
rake |
rails generate controller action ... |
bundle - gem install bundler view
Git
git push --set-upstream remote branch |
link current branch to remote branch |
git push -u origin branch |
create and link branch remotely |
git config [--global] user.name name |
git config [--global] user.email email |
git clone <repo> [<dir>] |
clone <repo> with <dir> name |
git revert <commit> |
git diff master...<branch> |
difference between <branch> and where <branch> diverged from master |
Heroku
heroku version |
heroku login |
heroku keys:add |
heroku create [name] |
heroku open |
opens running app in browser |
heroku rename name |
heroku logs |
git push heroku master |
rebuild/rerun app with latest code? |
Rake
rake -T [namespace] |
display all tasks [in namespace] |
Rubocop
rubocop --auto-gen-config |
rubocop -a |
auto cleanup |
Active Record
ContentDefinition.where('display_name NOT LIKE (?)', ['test%']) |
Collection.delete_all |
Work
lsof -wni tcp:9292 |
NS |
lsof -wni tcp:7999 |
AUTH |
lsof -wni tcp:8081 |
RLS |
Ruby Version Manager (RVM)
X = version you want to use, such as 2.1.4
Minitest
ruby path/to/file.rb --name test_method_name |
Run one specific test |
|
Created By
https://github.com/waylandhe
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
More Cheat Sheets by Wayland He