git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| INSTALL JAVA | |
| $ sudo apt-get update && sudo apt-get install default-jre | |
| INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html | |
| $ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
| $ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
| $ sudo apt-get update && sudo apt-get install elasticsearch | |
| $ sudo update-rc.d elasticsearch defaults 95 10 | |
| $ sudo service elasticsearch restart | |
| $ sudo service elasticsearch status |
| #!/usr/bin/env ruby | |
| # Place in your project .git/hooks/pre-commit | |
| # Heavily inspired by https://raw.githubusercontent.com/balabhadra/githooks/master/pre-commit, so thank you to him | |
| ############# CONFIGURATION | |
| # The two sections of regular expressions below ("forbidden" and "warning") | |
| # will trigger a commit failure, *if* they are found on an added or edited line. |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
development https://git.heroku.com/xxx.git (fetch)
development https://git.heroku.com/xxx.git (push)
origin [email protected]:xxx/xxx.git (fetch)
origin [email protected]:xxx/xxx.git (push)
production https://git.heroku.com/xxx.git (fetch)
production https://git.heroku.com/xxx.git (push)
staging https://git.heroku.com/xxx.git (fetch)
heroku restartheroku pg:reset DATABASE (no need to change the DATABASE)heroku run rake db:migrateheroku run rake db:seed (if you have seed)One liner
heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate
| require 'csv' | |
| file = "#{Rails.root}/public/data.csv" | |
| table = User.all;0 # ";0" stops output. Change "User" to any model. | |
| CSV.open( file, 'w' ) do |writer| | |
| writer << table.first.attributes.keys | |
| table.each do |s| | |
| writer << s.attributes.values |