View index.html
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<base href="/">
<title></title>
View invoicePivot.html
<style>
* {
font-family: Verdana;
}
.node {
border: solid 1px white;
font: 10px sans-serif;
line-height: 12px;
View sample.js
Promise = require('bluebird')
var A = function() {
return new Promise(function(resolve, reject) {
var result = 'A is done'
console.log(result)
resolve(result);
})
View install.md

My goal here was the create a routable graph for Chicago.

I used Ubuntu 12.04LTS on an m2.4xlarge just to be sure memory wasn't too much of an issue.

Install

Start a screen session and start downloading an OSM extract (I used this extract of Illinois). In another screen I did the following:

  sudo apt-get update && sudo apt-get upgrade -y
  sudo apt-get -y install git make cmake build-essential \
View install.md

Install Cucumber with Rspec, Guard, Factory Girl(?) and Spork

Using during Hartl rails 4.0 guide (http://ruby.railstutorial.org/chapters)

Gems

group :development, :test
  gem 'guard-rspec'
  gem 'guard-livereload'
  gem 'spork-rails', github: 'sporkrb/spork-rails' # rubygems version not rails 4 compatible
  gem 'guard-spork'
View deploy.rake
# lib/tasks/deploy.rake
namespace :deploy do
desc 'Deploy to staging environment'
task :staging do
exec 'mina deploy -f config/deploy/staging.rb'
end
end
View apache2-unicorn-conf
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
DocumentRoot /rails_app_directory/public
# Redirect all requests that don't match a file on disk under DocumentRoot get proxied to Puma
RewriteEngine On
<Proxy balancer://unicornservers>
BalancerMember http://127.0.0.1:5100
View your_controller.rb
class YourController < ApplicationController
before_filter :cors_preflight_check, only: [:settings]
after_filter :cors_set_access_control_headers, only: [:settings]
def settings
# YOUR CODE TO GET CLIENT'S WIDGET SETTINGS HERE
end
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
View gist:040782c3643003fb628955ce59d8e323
class PropertiesController < ApplicationController
include ActionController::Live
before_action :find_county
def index
response.headers["Content-Type"] ||= 'text/csv'
response.headers["Content-Disposition"] = "attachment; filename=#{@county.csv_file_name}"
response.stream.write Property::CSV_HEADERS.to_csv
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Close infowindow programatically | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;