This file contains 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
# 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 |
This file contains 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
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 |
This file contains 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 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 |