Skip to content

Instantly share code, notes, and snippets.

View rpossan's full-sized avatar
🎯
Focusing

Ronaldo Possan rpossan

🎯
Focusing
View GitHub Profile
# Generate the models Estado and Cidade:
# rails generate Estado sigla:string nome:string
# rails generate Cidade estado:references nome: string
# rails db:migrate
# Put this code on your db/seeds.rb of your Ruby On Rails application
# rails db:seed
Estado.destroy_all
@rpossan
rpossan / install.sh
Created June 28, 2017 18:50 — forked from ultimagriever/install.sh
Start PhantomJS server as a Linux service
export TMPDIR=/tmp/
cd /usr/local/lib
mkdir phantom
cd phantom
wget https://gist.githubusercontent.com/ultimagriever/72fcb3e4446460638d65aecd2fbee98c/raw/9d915c60921219900b60c64cf5379c54d63ca43c/restart.sh
wget https://gist.githubusercontent.com/ultimagriever/72fcb3e4446460638d65aecd2fbee98c/raw/9d915c60921219900b60c64cf5379c54d63ca43c/start.sh
wget https://gist.githubusercontent.com/ultimagriever/72fcb3e4446460638d65aecd2fbee98c/raw/9d915c60921219900b60c64cf5379c54d63ca43c/status.sh
wget https://gist.githubusercontent.com/ultimagriever/72fcb3e4446460638d65aecd2fbee98c/raw/9d915c60921219900b60c64cf5379c54d63ca43c/stop.sh
chmod +x *.sh
ln -s /usr/local/lib/phantom/restart.sh /usr/local/bin/phantom-restart
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin