Skip to content

Instantly share code, notes, and snippets.

Avatar

Simone Carletti weppos

View GitHub Profile
@weppos
weppos / capistrano_database_yml.rb
Created Jul 27, 2008
Provides a couple of tasks for creating the database.yml configuration file dynamically when deploy:setup is run.
View capistrano_database_yml.rb
#
# = 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
@weppos
weppos / capistrano_passenger_deploy.rb
Created Jul 29, 2008
Provides tasks for deploying a Rails application with Passenger (aka mod_rails).
View capistrano_passenger_deploy.rb
#
# = 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_fastcgi_deploy.rb
Created Jul 29, 2008
Provides tasks for deploying a Rails application with FastCGI.
View capistrano_fastcgi_deploy.rb
#
# = 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 / title_helper.rb
Created Aug 3, 2008
Provides helpers for managing page title.
View title_helper.rb
#
# = 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 / alignments.css
Last active Aug 29, 2015
This CSS file contains a small set of CSS classes * for changing text and image alignment without inline code.
View alignments.css
/*
* = CSS alignments
*
* http://gist.github.com/4903
*
* This CSS file contains a small set of CSS classes
* for changing text and image alignment without inline code.
*
* For example, to center an image in the middle of the line
* forget the deprecated <center> tag or
View gist:102138
# Validates whether the value of the specified attribute matches the format of an URL,
# as defined by RFC 2396. See URI#parse for more information on URI decompositon and parsing.
#
# This method doesn't validate the existence of the domain, nor it validates the domain itself.
#
# Allowed values include http://foo.bar, http://www.foo.bar and even http://foo.
# Please note that http://foo is a valid URL, as well http://localhost.
# It's up to you to extend the validation with additional constraints.
#
# class Site < ActiveRecord::Base
View gist:241979
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
View compression-gzip.conf
# Enables compression for everything except compressed images.
# See http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
# Required mod_deflate and mod_headers
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
<Location />
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
View redmine-080-to-090.conf
# Permanently redirects all legacy Redmine 0.8.0 URLs
# to the new Redmine 0.9.0 RESTful versions
# See http://www.redmine.org/issues/1901
# PROJECT
RedirectMatch 301 ^/projects/show/([^/]+) /projects/$1
# ACTIVITY
View super_struct.rb
#
# = 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/
You can’t perform that action at this time.