- Upgrade Rails to 5.1+ for webpacker integration
- Run
nvm install node && nvm alias default stable
to use latest version of node. - Install Yarn
- Add
webpack-dev-server
and configure as below. - Run
rails new elm_on_rails --webpack
- Run
rails webpacker:install
if needed. - Run
rails webpacker:install:elm
- Add
<%= javascript_pack_tag "javascript_filename_without_extension" %>
to an html view.
This file contains hidden or 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
# Modified from the Twitter Bootstrap Rails gem's Bootstrap Flash Helper (bootstrap 3) for Bootstrap 4 | |
# Place in the helpers folder | |
module BootstrapFlashHelper | |
ALERT_TYPES = [ | |
:primary, | |
:secondary, | |
:success, | |
:danger, | |
:warning, | |
:info, |
This file contains hidden or 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
nvm install node && nvm alias default stable | |
npm install -g expo-cli | |
expo init | |
expo login | |
expo start --tunnel |
This file contains hidden or 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
Rails.application.eager_load! | |
ActiveRecord::Base.descendants.map { |m| [m.name, m.all.size] }.sort_by { |m, s| -s } | |
# Print on seperate lines | |
# puts ActiveRecord::Base.descendants.map { |m| [m.name, m.all.size] }.sort_by { |m, s| -s }.map(&:inspect) |
This file contains hidden or 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
Rails.application.eager_load! | |
ActiveRecord::Base.descendants.map { |m| ActiveRecord::Base.connection.reset_pk_sequence!(m.table_name) } |
This file contains hidden or 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. Delete everything except the hidden .c9 folder | |
# 2. Setup aliases | |
# Setup Postgres database | |
sudo service postgresql start | |
sudo sudo -u postgres psql | |
CREATE USER username SUPERUSER PASSWORD 'password'; | |
\q | |
echo "export USERNAME=username" >> ~/.profile | |
echo "export PASSWORD=password" >> ~/.profile | |
. ~/.profile |
This file contains hidden or 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
heroku pg:backups:capture | |
heroku pg:backups:download | |
pg_restore --verbose --clean --no-acl --no-owner -U ubuntu -d app_development latest.dump |
This file contains hidden or 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
sudo service postgresql start | |
sudo sudo -u postgres psql | |
CREATE USER username SUPERUSER PASSWORD 'password'; | |
\q | |
. ~/.bashrc | |
echo "export USERNAME=username" >> ~/.bashrc | |
echo "export PASSWORD=password" >> ~/.bashrc | |
. ~/.bashrc | |
sudo sudo -u postgres psql |
This file contains hidden or 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
{ | |
"Version": "YYYY-MM-DD", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": "s3:*", | |
"Resource": [ | |
"arn:aws:s3:::BUCKET_NAME", | |
"arn:aws:s3:::BUCKET_NAME/*" | |
] |