git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| #!/usr/bin/env ruby | |
| =begin | |
| = Geographic Searches With Postgres's Earthdistance and Cube Extensions | |
| This program shows how to easily create a Postgres database that uses the Cube | |
| and Earthdistance extensions to perform fast queries on geographic data. | |
| Briefly, the problem this code solves is "show me all places within 50 | |
| kilometers of New York City." |
| require 'rubygems' | |
| require 'bundler' | |
| Bundler.require | |
| require './application' | |
| namespace :assets do | |
| desc 'compile assets' | |
| task :compile => [:compile_js, :compile_css] do | |
| end |
| require 'httparty' | |
| require 'eventmachine' | |
| class Request | |
| include EM::Deferrable | |
| @@requests = [] | |
| attr_reader :method, :params |
| # Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |
| module Devise | |
| module Models | |
| module RemoteAuthenticatable | |
| extend ActiveSupport::Concern | |
| # | |
| # Here you do the request to the external webservice | |
| # | |
| # If the authentication is successful you should return | |
| # a resource instance |
| module Devise | |
| module Strategies | |
| class RemoteAuthenticatable < Authenticatable | |
| # | |
| # For an example check : https://github.com/plataformatec/devise/blob/master/lib/devise/strategies/database_authenticatable.rb | |
| # | |
| # Method called by warden to authenticate a resource. | |
| # | |
| def authenticate! | |
| # |
| # Raw transaction API example work-through | |
| # Send coins to a 2-of-3 multisig, then spend them. | |
| # | |
| # For this example, I'm using these three keypairs (public/private) | |
| # 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU | |
| # 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk | |
| # 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw | |
| # First: combine the three keys into a multisig address: | |
| ./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9 |
| # /etc/nginx/sites-available/app | |
| upstream app_server { | |
| server unix:/tmp/.unicorn_app.sock fail_timeout=0; | |
| } | |
| server { | |
| listen 80; | |
| server_name app.com; |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |