(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/bash | |
| # Install docker in ubuntu 14.04 | |
| # Update your apt sources | |
| sudo apt-get update | |
| sudo apt-get install --assume-yes apt-transport-https ca-certificates | |
| sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
| sudo touch /etc/apt/sources.list.d/docker.list | |
| sudo chmod 777 /etc/apt/sources.list.d/docker.list | |
| echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' >> /etc/apt/sources.list.d/docker.list |
| { | |
| "presets": ["es2015"], | |
| "plugins": ["transform-runtime"] | |
| } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
docker network create lb
docker run -d --name nginx1 --net lb --net-alias nginx nginx
docker run -d --name nginx2 --net lb --net-alias nginx nginx
docker run -d --name nginx-lb -p 80:80 -v $(pwd):/data --net lb nginx
docker exec -ti nginx-lb bash
| # Add these methods to your ApplicationController. Then, any controller | |
| # that inherits from it will have these methods and can programmatically | |
| # determine what filters it has set. | |
| class ApplicationController < ActionController::Base | |
| def self.filters(kind = nil) | |
| all_filters = _process_action_callbacks | |
| all_filters = all_filters.select{|f| f.kind == kind} if kind | |
| all_filters.map(&:filter) | |
| end |
| RSpec.configure do |config| | |
| config.before(:suite) do | |
| DatabaseCleaner.clean_with(:truncation) | |
| end | |
| config.before(:each) do | |
| DatabaseCleaner.strategy = :transaction | |
| end | |
| config.before(:each, js: true) do |
Part1 Software Engineering Basics
Part2 Web Development Basics
| ######################## | |
| # Customize the test machine | |
| ######################## | |
| machine: | |
| # Set the timezeone - any value from /usr/share/zoneinfo/ is valid here | |
| timezone: | |
| America/Los_Angeles | |
| # Version of ruby to use |
| class API::V1::BaseController < ApplicationController | |
| skip_before_filter :verify_authenticity_token | |
| before_filter :cors_preflight_check | |
| after_filter :cors_set_access_control_headers | |
| def cors_set_access_control_headers | |
| headers['Access-Control-Allow-Origin'] = '*' | |
| headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |