First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel
Then ssh with root account, run this in termianl:
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash| # | |
| # Most of the regexes here are from http://twitter.com/schuyler. | |
| # They were posted on Forrst (http://forr.st/~zDa) as a public post, | |
| # so I reworked them into a full class. | |
| # | |
| # Added: | |
| # => (limited) international support -- should handle US/Canada and most of western europe | |
| # => added :receipient, :postcode, and :country fields | |
| # => state/province detection built-in |
| // create an IAM Lambda role with access to dynamodb | |
| // Launch Lambda in the same region as your dynamodb region | |
| // (here: us-east-1) | |
| // dynamodb table with hash key = user and range key = datetime | |
| console.log('Loading event'); | |
| var AWS = require('aws-sdk'); | |
| var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); | |
| exports.handler = function(event, context) { |
| <div class="row"> | |
| <div class="one column">One</div> | |
| <div class="eleven columns">Eleven</div> | |
| </div> | |
| <div class="row"> | |
| <div class="two columns">Two</div> | |
| <div class="ten columns">Ten</div> | |
| </div> | |
| <div class="row"> | |
| <div class="three columns">Three</div> |
| <form> | |
| <div class="row"> | |
| <div class="six columns"> | |
| <label for="exampleEmailInput">Your email</label> | |
| <input class="u-full-width" type="email" placeholder="test@mailbox.com" 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> |
| <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> |
| 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 |
| 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") |