Skip to content

Instantly share code, notes, and snippets.

❯❯❯ brew config ⏎ ✱ (git:mergetastic_plus_sam)
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: 9a4b0ebd9fb803b6936a51813e397c75296002f1
Last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.10-x86_64
Xcode: 6.1
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class Pulse < Rails::Rack::Metal
def call(env)
if env["PATH_INFO"] =~ /^\/heartbeat/
[200, {"Content-Type" => "text/html"}, (1..10).to_a.to_sentence]
else
super
end
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class RackRoll < Rails::Rack::Metal
def call(env)
[ 302, {'Location'=> 'http://www.youtube.com/watch?v=oHg5SJYRHA0' }, [] ]
end
end
diff --git a/ext/extconf.rb b/ext/extconf.rb
index c959833..241ea67 100644
--- a/ext/extconf.rb
+++ b/ext/extconf.rb
@@ -1,13 +1,13 @@
# windows compatibility, need different library name
-if(PLATFORM =~ /mingw|mswin/) then
+if(RUBY_PLATFORM =~ /mingw|mswin/) then
# SUPER DARING APP TEMPLATE 1.0
# By Peter Cooper
# Link to local copy of edge rails
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' }
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
module ActiveRecord::ConnectionAdapters
class PostgreSQLAdapter < AbstractAdapter
def client_min_messages=(level)
@logger.silence do
execute("SET client_min_messages TO '#{level}'")
end
end
end
end
End Result: What are the Lat/Lng points for zipcode 60614's boundaries in chicago
I downloaded the shapefile from here
http://egov.cityofchicago.org:80/webportal/COCWebPortal/COC_ATTACH/zipcodes.zip
This page gave me directions on where to find the SRID
http://egov.cityofchicago.org:80/webportal/COCWebPortal/COC_ATTACH/Chicago_GIS_Addressing_Stds_May_19.pdf
1 Technical Mapping Specifications
Given a preexisting lat/lng
lat | 41.9219
lng | -87.6562
and a table that I added a geometry column via the following sql
SELECT AddGeometryColumn('bars','the_geom','9102671','MULTILINESTRING',2);
(the srid is illinois, east, 9102671)
(i think lat-lngs will be stored as multistring)
require "#{File.dirname(__FILE__)}/../vendor/bundler_gems/environment"
class Rails::Boot
def run
load_initializer
extend_environment
Rails::Initializer.run(:set_load_path)
end
def extend_environment
@samgranieri
samgranieri / .gitignore
Created January 29, 2010 04:55
Rails 3 Capistrano Notes
db/*.sqlite3
log/*.log
tmp/**/*
bin/*
vendor/gems/ruby/1.8/*
!vendor/gems/ruby/1.8/cache/