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| # Call scopes directly from your URL params: | |
| # | |
| # @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
| module Filterable | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| # Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
| # with their associated values. For example, "{ status: 'delayed' }" would call |
| class Integer | |
| def to_a | |
| arr = [] | |
| tmp = self | |
| while tmp>0 | |
| arr << tmp%10 | |
| tmp /= 10 | |
| end | |
| arr.reverse | |
| end |
| ## rpc.gd | |
| # An experiment in using HTTPClient | |
| # for blocking RPCs | |
| # @author bibby<[email protected]> | |
| # | |
| # get( url ) | |
| # post( url, body ) | |
| # put( url, body ) | |
| # delete( url ) |
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "net/http" | |
| "net/url" | |
| ) | |
| const ( |
| require 'Twitter' #gem install twitter | |
| while true | |
| begin | |
| # Create a read write application from : | |
| # https://apps.twitter.com | |
| # authenticate it for your account | |
| # fill in the following | |
| config = { | |
| consumer_key: '', | |
| consumer_secret: '', |
| directory = ARGV.shift || Dir.pwd | |
| $dont_get_into = ['.','..'] | |
| $allowed = { | |
| 'Ruby' => '.rb', | |
| 'Ruby HTML Templates' => '.html.erb', | |
| 'YAML' => '.yml', | |
| 'RDoc' => '.rdoc', | |
| 'HTML' => '.html', | |
| 'Javascript' => '.js', | |
| 'CSS' => '.css', |
| require 'sinatra' # gem install sinatra --no-rdoc --no-ri | |
| set :port, 3000 | |
| set :environment, :production | |
| html = <<-EOT | |
| <html><head><style> | |
| #text{width:100%; font-size: 15px; padding: 5px; display: block;} | |
| </style></head><body> | |
| <input id="text" placeholder="Write then press Enter."/> | |
| <div id="chat"></div> |
This page provides you with a little help getting started with the new MongoDB C driver.
For more information on the C API, please refer to the online API Documentation for the C driver.