This file contains hidden or 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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains hidden or 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
| docker login | |
| docker tag myproject_website coolrider/rails5:latest | |
| docker push coolrider/rails5:latest |
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "bento/centos-6.8" | |
| config.vm.network "forwarded_port", guest: 4000, host: 4000 | |
| config.vm.network "forwarded_port", guest: 9200, host: 9222 | |
| config.vm.network "private_network", ip: "192.168.33.10" | |
| config.vm.synced_folder "Developer", "/home/vagrant/Developer" |
This file contains hidden or 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
| require 'nokogiri' | |
| require 'open-uri' | |
| # Get a Nokogiri::HTML::Document for the page we’re interested in... | |
| doc = Nokogiri::HTML(open('http://en.wiktionary.org/wiki/Appendix:Indian_surnames')) | |
| #Search for nodes by xpath | |
| doc.xpath('/html/body/div[3]/div[3]/div[4]/ul/li').each do |link| | |
| puts link.content | |
| end |
This file contains hidden or 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
| #Prerequisites | |
| #Basic Ruby/Rails knowledge, including an installed version of Ruby 1.9.2, Rubygems, Bundler, and Rails 3. | |
| #Basic Git knowledge, including an installed version of Git. | |
| #Create a Heroku account http://www.heroku.com/ | |
| #All the commands work on linux | |
| #Install the Heroku client: | |
| $ gem install heroku |
This file contains hidden or 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
| class User < ActiveRecord::Base | |
| has_many :posts | |
| end | |
| class Post < ActiveRecord::Base | |
| belongs_to :user | |
| delegate :author , :to => user | |
| end |