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
| ;(function( $, window ) { | |
| var _defaults = { | |
| row : 4, // tiles in x axis | |
| column : 4, // tiles in y axis | |
| activeTileClass: 'tileActive' | |
| }; | |
| function extractActiveTile( $tiles ) { | |
| if( $tiles.length > 0 ) { | |
| var string_tiles = $tiles.split('|'); |
| 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 |
| sudo visudo | |
| %wheel ALL=NOPASSWD:/usr/sbin/passenger-status |
| #!/usr/bin/ruby | |
| require 'open3' | |
| require 'logger' | |
| def get_list_passenger_process | |
| process, stderr, status = Open3.capture3("passenger-status") | |
| list_process = process.gsub(/^(.*?)(Requests in queue: (.$))/m, '') | |
| list_process = list_process.split("\n *") | |
| list_process = list_process.reject(&:empty?).map do |process| |
| #!/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
| #!/bin/sh | |
| # This is my script for setting up ubuntu machines in | |
| # a similar setup to how thoughtbot's laptop script | |
| # works (https://github.com/thoughtbot/laptop) | |
| # how to run | |
| # curl --remote-name [change to raw file url] && sudo chmod +x ubuntu.sh && ./ubuntu.sh 2>&1 | tee ~/laptop.log | |
| sudo apt update && sudo apt upgrade -y |
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 |