Skip to content

Instantly share code, notes, and snippets.

View luigi's full-sized avatar

Luigi Ray-Montañez luigi

  • Atlanta, GA
  • 22:07 (UTC -04:00)
View GitHub Profile
Is:
<h1><img src="logo.png" alt="My Site Title" /></h1>
equivalent to:
<h1>My Site Title</h1>
in Google's eyes?
$ bundle install
Fetching source index from http://rubygems.org/
No compatible versions could be found for required dependencies:
Conflict on: "mongo":
* mongo (1.0.1) activated by mongo (= 1.0.1, runtime)
* mongo (= 0.15, runtime) required by mongo_mapper (>= 0, runtime)
All possible versions of origin requirements conflict.
$ bundle install
Fetching source index from http://rubygems.org/
No compatible versions could be found for required dependencies:
Conflict on: "mongo":
* mongo (1.0.1) activated by plucky (= 0.1.2, runtime)
* mongo (= 0.15, runtime) required by mongo_mapper (>= 0, runtime)
All possible versions of origin requirements conflict.
$ rails server -e production
=> Booting WEBrick
=> Rails 3.0.0.beta application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
h scroll left
j scroll down
k scroll up
l scroll right
gg scroll to top of the page
G scroll to bottom of the page
f activate link hints mode to open in current tab
F activate link hints mode to open in new tab
r reload
function zipToState(zip) {
var state;
if (zip >= '99501' && zip <= '99950') { state = 'AK'; }
else if (zip >= '35004' && zip <= '36925') { state = 'AL'; }
else if (zip >= '71601' && zip <= '72959') { state = 'AR'; }
else if (zip >= '75502' && zip <= '75502') { state = 'AR'; }
else if (zip >= '85001' && zip <= '86556') { state = 'AZ'; }
else if (zip >= '90001' && zip <= '96162') { state = 'CA'; }
else if (zip >= '80001' && zip <= '81658') { state = 'CO'; }
else if (zip >= '06001' && zip <= '06389') { state = 'CT'; }

National Data Catalog - Catalog Scraper Specification

The National Data Catalog stores metadata about data sets and APIs published by all levels of government. It helps developers, researchers, and journalists search for, identify, and work with data sources that would otherwise take significant effort to track down.

Here are some resources:

@luigi
luigi / steelify.html
Created October 16, 2009 21:15
steelify any web page!
<style type="text/css">
#mSteele {
width:576px;
height:388px;
position:absolute;
top:100px;
right:0;
background: transparent;
}
</style>
# Adapted from ActiveSupport's parameterize
# http://github.com/rails/rails/blob/ea0e41d8fa5a132a2d2771e9785833b7663203ac/activesupport/lib/active_support/inflector.rb#L259
def slugify(str, sep = '-')
str.gsub!(/[^a-z0-9\-_\+]+/i, sep)
unless sep.nil? || sep == ''
re_sep = Regexp.escape(sep)
str.gsub!(/#{re_sep}{2,}/, sep)
str.gsub!(/^#{re_sep}|#{re_sep}$/i, '')
end
module Rack
class ChromeFrame
def initialize(app, options={})
@app = app
end
def call(env)
status, headers, response = @app.call(env)
if env['HTTP_USER_AGENT'] =~ /MSIE/ && response.content_type == 'text/html'