$ git checkout master
$ git fetch --all --prune
$ git rebase origin/master
$ git checkout my-feature-branch
$ git rebase master
| #Add ENV strings into AWS Parameter Store (as one parameter). All strings will be separated by the newline | |
| #We are getting ENV string separated by the newline and pub them in the dotenv | |
| aws ssm get-parameter --name Param-with-env --region eu-west-1 --query Parameter.Value | sed -e 's/^"//' -e 's/"$//' | awk '{gsub(/\\n/,"\n")}1' >> .env |
| # Access tty to ask for confirmation even if we're in a pipe (thanks Pow) | |
| TTY="/dev/$( ps -p$$ -o tty | tail -1 | awk '{print$1}' )" | |
| read -p "*** Do you want to reinstall the 'pg' gem [y/n]?" REINSTALL_PG < $TTY | |
| if [[ $REINSTALL_PG == "y" ]]; then | |
| gem uninstall pg | |
| gem install pg | |
| fi | |
| # Ask if the user wants to setup the db with a 'root' superuser? |
| class ApplicationController < ActionController::Base | |
| # ... | |
| unless Rails.application.config.consider_all_requests_local | |
| rescue_from Exception, with: lambda { |exception| render_error 500, exception } | |
| rescue_from ActionController::RoutingError, ActionController::UnknownController, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: lambda { |exception| render_error 404, exception } | |
| end | |
| private | |
| def render_error(status, exception) |
| sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib ~/.rvm/gems/ruby-1.9.3-p0@global/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |