Skip to content

Instantly share code, notes, and snippets.

<h1>Simple Search/Pagination Example</h1>
<%= will_paginate @users %>
<% @users.each do |user| %>
<div>
<%= user.name %> (<%= user.email %>)
</div>
<% end %>
<%= will_paginate @users %>
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
#!/usr/bin/env ruby
require 'rubygems'
require 'mongo'
USER = 'tiger'
PASS = 'censusTIGER2009'
db = Mongo::Connection.new('flame.mongohq.com', 27058).db('tiger-2009')
db.authenticate(USER, PASS)
DaCottage:~ chad$ rvm --trace 1.8.7@pusher
--trace 1.8.7@pusher
rvm 0.1.38 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
+ [[ -z '' ]]
+ [[ ! -z '' ]]
+ [[ ! -z '' ]]
+ [[ ! -z '' ]]
+ [[ 1 -gt 0 ]]
# Initial code project
#!/usr/bin/env ruby
class Person
attr_reader :name
def initialize(name)
@name = name
end
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
SELECT DISTINCT l.id, f.id, c.id
FROM public.lobbyists r
INNER JOIN public.chi_lobbyists l
ON r.first_name = l.first_name and r.last_name = l.last_name
INNER JOIN public.chi_firms f
ON r.employer_name = f.name
INNER JOIN public.chi_clients c
ON r.client_name = c.name
ssh-add; ssh -tqA -ljoin palisade.pairmill.com 4784c03e0e6f75093551
@chadwpry
chadwpry / gist:1608769
Created January 13, 2012 21:22
Postgres database.yml
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: postgresql
host: localhost
port: 5432
username: chad
password:
database: fudtruck_development
schema_search_path: public