rails generate <type> --help # for examples
# Model (+ migration, test, fixtures)
rails generate model NAME [field[:type][:index] field[:type][:index]] [options]
rails generate model post title:string blog:references published:boolean position:integer
rails generate model product supplier:references{polymorphic}
$ rails new <app-name> --database=postgresql --webpack=react
$ cd <app-name>
$ echo '.idea' >> .gitignore # remove RubyMine's config
$ echo "ruby '2.4.0'" >> Gemfile # for Heroku Ruby version
$ git add .
$ git commit -m "Initial commit"
# Create new repo on GitHub with same name...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -f Gemfile ]; then | |
echo "Are you sure you're in a Ruby on Rails app?" | |
else | |
ln -s "$(pwd)" ~/.puma-dev/"$(basename `pwd`)" | |
puma-dev -install | |
echo "Your app should be available at http://$(basename `pwd`).dev and https://$(basename `pwd`).dev now!" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this file in your /Users/<your_username>/Library/Preferences/<rubymine_version>/rubymine.vmoptions | |
# Ex: /Users/bob/Library/Preferences/RubyMine80/rubymine.vmoptions | |
-Xms128m | |
-Xmx1536m | |
-XX:MaxPermSize=250m | |
-XX:+UseCompressedOops |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'aws-sdk' | |
s3 = AWS::S3.new( | |
:access_key_id => 'PASTE_HERE', | |
#### SECRET KEY ##### | |
:secret_access_key => 'PASTE_SECRET_KEY_HERE') | |
#### DO NOT COMMIT #### |