Skip to content

Instantly share code, notes, and snippets.

View weppos's full-sized avatar

Simone Carletti weppos

View GitHub Profile
#
# = SuperStruct
#
# SuperStruct is an enhanced version of the Ruby Standard library <tt>Struct</tt>.
#
# Compared with the original version, it provides the following additional features:
# * ability to initialize an instance from Hash
# * ability to pass a block on creation
#
# You can read more at http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} !^id=([0-9]*)$
RewriteRule .* - [env=send_x_robot:true]
Header set X-Robots-Tag "noindex" env=send_x_robot
@weppos
weppos / title_helper.rb
Created August 3, 2008 20:46
Provides helpers for managing page title.
#
# = Rails Title Helper
#
# Provides helpers for managing page title.
#
# Category:: Rails
# Package:: Helpers
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2008 The Authors
# License:: MIT License
@weppos
weppos / capistrano_fastcgi_deploy.rb
Created July 29, 2008 15:37
Provides tasks for deploying a Rails application with FastCGI.
#
# = Capistrano FastCGI deploy tasks
#
# Provides tasks for deploying a Rails application with FastCGI.
#
# Category:: Capistrano
# Package:: FastCGI
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2008 The Authors
# License:: MIT License
@weppos
weppos / capistrano_passenger_deploy.rb
Created July 29, 2008 14:59
Provides tasks for deploying a Rails application with Passenger (aka mod_rails).
#
# = Capistrano Passenger deploy tasks
#
# Provides tasks for deploying a Rails application with Passenger (aka mod_rails).
#
# Category:: Capistrano
# Package:: Passenger
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2008 The Authors
# License:: MIT License
@weppos
weppos / capistrano_database_yml.rb
Created July 27, 2008 10:04
Provides a couple of tasks for creating the database.yml configuration file dynamically when deploy:setup is run.
#
# = Capistrano database.yml task
#
# Provides a couple of tasks for creating the database.yml
# configuration file dynamically when deploy:setup is run.
#
# Category:: Capistrano
# Package:: Database
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2010 The Authors