Goals of this tutorial:
- deploy a new Rails app with capistrano
- make it fast (total process takes less than 5 minutes)
- make it simple (no unecessary config)
- manual ssh to the server not required
Rails application stack:
- nginx
- unicorn
- postgresql
# spec/rails_helper.rb | |
require_relative 'support/webpack_test_helper.rb' | |
# ... | |
config.before(:suite) do | |
# Compile webpack if necessary. | |
# Only runs if checksum of JS files has changed | |
WebpackTestHelper.compile_webpack_assets | |
end |
Goals of this tutorial:
Rails application stack:
console.log(`%c :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
::: |
monitor: bundle exec ruby monitor.rb |
require 'net/http' | |
page_id = "your page id" | |
access_token = "your access token" | |
html_source = "your html content" | |
uri = URI.parse("https://graph.facebook.com/v2.6/#{page_id}/instant_articles") | |
request = Net::HTTP::Post.new(uri.path) | |
request.set_form_data({ | |
access_token: access_token, |
require 'net/http' | |
require 'colorize' | |
# find all available three-letter .io domains | |
alph = ('a'..'z') | |
# generate all three-character strings | |
threes = alph.map { |a| alph.map { |b| alph.map { |c| "#{a}#{b}#{c}" } } }.flatten | |
def io_available?(tld) | |
url = URI.parse("http://www.nic.io/cgi-bin/whois?query=#{tld}.io") |
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
<div class="six columns"> | |
<ul> | |
<li>Unordered lists have basic styles</li> | |
<li> | |
They use the circle list style | |
<ul> | |
<li>Nested lists styled to feel right</li> | |
<li>Can nest either type of list into the other</li> | |
</ul> | |
</li> |
<form> | |
<div class="row"> | |
<div class="six columns"> | |
<label for="exampleEmailInput">Your email</label> | |
<input class="u-full-width" type="email" placeholder="[email protected]" id="exampleEmailInput"> | |
</div> | |
<div class="six columns"> | |
<label for="exampleRecipientInput">Reason for contacting</label> | |
<select class="u-full-width" id="exampleRecipientInput"> | |
<option value="Option 1">Questions</option> |