Skip to content

Instantly share code, notes, and snippets.

class Post < ActiveRecord::Base
# ...
def to_param
"#{id}-#{title.parameterize}"
end
end
rescue_from ActionController::RoutingError,
ActionController::UnknownAction,
ActiveRecord::RecordNotFound,
ActionView::MissingTemplate,
ActionController::MethodNotAllowed,
WillPaginate::InvalidPage, :with => :route_not_found
protected
# 404
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
sudo usermod -g wanalab emilien
umask 002
git --bare --shared init
@etaque
etaque / .bashrc
Created July 8, 2009 21:53 — forked from defunkt/.bashrc
# $ tweet Hi mom!
#
# Put this in ~/.bashrc or wherever.
# If it doesn't work, make sure your ~/.netrc is right
#
# (Thanks to @anildigital and @grundprinzip for curl-fu)
function tweet {
curl -n -d status="$*" https://twitter.com/statuses/update.xml --insecure &> /dev/null
echo "tweet'd"