locally
go to the amazon web interface
note your AWS_USER_ID
in the upper right hand corner. create a new
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
.
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
# make faker a bit more swiss-friendly :) | |
module Faker | |
class Company | |
# Add swiss suffixes like AG, GmbH etc. | |
def self.suffix | |
%w(AG GmbH und\ Söhne und\ Partner &\ Co. Gruppe LLC Inc.).rand | |
end | |
end | |
require 'rubygems' | |
require 'sinatra' | |
require 'pony' | |
require 'haml' | |
set :haml, {:format => :html5} | |
set :public, File.dirname(__FILE__) | |
set :views, File.dirname(__FILE__) | |
# Create the page class and give it a title of Contact for the layout |
# Helper class for importing files with records to the database. | |
class SeedFile | |
def self.import(path) | |
new(path).import | |
end | |
attr_reader :path | |
def initialize(path) | |
@path = Pathname(path) |
CURRENT_RUBY = 'ree-1.8.7-2010.02' | |
RUBY_PATH = "/home/rails/.rvm/rubies/#{CURRENT_RUBY}" | |
GEM_HOME = "/home/rails/.rvm/gems/#{CURRENT_RUBY}" | |
ssh_options[:paranoid] = false | |
ssh_options[:forward_agent] = true | |
default_run_options[:pty] = true | |
set :stages, %w(staging production) |
/* | |
An Albers Equal Area Conic projection in javascript, for protovis. | |
For centering the contiguous states of the USA in a 800x400 div, I used: | |
var scale = pv.Geo.scale(albers(23, -96, 29.5, 45.5)) | |
.range({ x: -365, y: -375 }, { x: 1200, y: 1200 }); | |
http://mathworld.wolfram.com/AlbersEqual-AreaConicProjection.html |
require 'formula' | |
class Gdal <Formula | |
url 'http://download.osgeo.org/gdal/gdal-1.7.2.tar.gz' | |
homepage 'http://www.gdal.org/' | |
md5 '05351f8cb61761ae579667e24a297fe6' | |
def options | |
[ | |
['--with-pg', "Include PostgreSQL support."], |
require 'formula' | |
class Geos <Formula | |
url 'http://download.osgeo.org/geos/geos-3.2.2.tar.bz2' | |
homepage 'http://trac.osgeo.org/geos/' | |
md5 'c5d264acac22fe7720f85dadc1fc17c6' | |
def options | |
[ | |
['--enable-python', "Enable build of python module."], |
locally
go to the amazon web interface
note your AWS_USER_ID
in the upper right hand corner. create a new
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
.
class VisitorStats | |
def initialize | |
@redis = Redis.new | |
end | |
# every time there's a hit, increment a counter for the | |
# day and week, and add the session id to a set of unique | |
# vistitors for the day/week | |
def hit(session_id) | |
today = Date.today |