This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# monkey-patching will_paginate to support internationalizated literals | |
module WillPaginate | |
module ViewHelpers | |
def page_entries_info(collection, options = {}) | |
entry_name = options[:entry_name] || | |
(collection.empty?? 'entry' : collection.first.class.name.underscore.sub('_', ' ')) | |
if collection.total_pages < 2 | |
case collection.size | |
when 0; _("No %{entries} found") % {:entries => entry_name.pluralize} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthlogicToDevise < ActiveRecord::Migration | |
def up | |
## Database authenticatable | |
rename_column :users, :crypted_password, :encrypted_password | |
## Recoverable | |
add_column :users, :reset_password_token, :string, :limit => 255 | |
add_column :users, :reset_password_sent_at, :datetime | |
## Rememberable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
es: | |
errors: | |
messages: | |
not_found: 'no encontrado' | |
already_confirmed: 'ya ha sido confirmada' | |
not_locked: 'no está bloqueada' | |
expired: "ha caducado, por favor pide uno nuevo" | |
not_saved: | |
one: "1 error evitó guardar este %{resource}:" | |
other: "%{count} errores evitaron guardar este %{resource}:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Don't forget to install hpricot gem. | |
namespace :erb do | |
namespace :to do | |
task :haml do | |
files = `find . -name *.html.erb` | |
files.each_line do |file| | |
file.strip! | |
`bundle exec html2haml #{file} | cat > #{file.gsub(/\.erb$/, ".haml")}` | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-0.8.52.tar.gz | |
$ tar xzvf ./nginx-0.8.52.tar.gz | |
$ rm ./nginx-0.8.52.tar.gz | |
$ gem install s3sync capistrano capistrano-ext passenger --no-ri --no-rdoc | |
$ passenger-install-nginx-module | |
# Automatically download and install Nginx? 2. No: I want to customize my Nginx installation | |
# Where is your Nginx source code located?: /usr/src/nginx-0.8.52 | |
# Where do you want to install Nginx to?: /opt/nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-0.8.52.tar.gz | |
$ tar xzvf ./nginx-0.8.52.tar.gz | |
$ rm ./nginx-0.8.52.tar.gz | |
$ gem install s3sync capistrano capistrano-ext passenger --no-ri --no-rdoc | |
$ passenger-install-nginx-module | |
# Automatically download and install Nginx? 2. No: I want to customize my Nginx installation | |
# Where is your Nginx source code located?: /usr/src/nginx-0.8.52 | |
# Where do you want to install Nginx to?: /opt/nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Selector de idioma | |
#dependencias: | |
# 1 - Rack locale del paquete Rack-contrib [1] | |
# USO: Se usa para detectar el idioma definido por el usuario en su browser ['HTTP_ACCEPT_LANGUAGE'] | |
# Esplicado aquí http://guides.rubyonrails.org/i18n.html#using-accept-language | |
# [1] http://github.com/rack/rack-contrib | |
# 2 - Routing-filter [1] | |
# USO: Establecer el locale en las URLs ej.: www.mysite.com/es/foo/bar | |
# NOTA: Si tambien quieres traducir las URL's usa la gema de Raul Murciano Translate_routes [2] (De momento sin cobertura para Rails3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AdsenseHelper | |
# Author: Tomasz Mazur (defkode@gmail.com) | |
# http://www.mydigitallife.info/2009/01/17/google-adsense-legacy-old-generation-code-reference-generate-and-get/ | |
# :slot | |
# :theme | |
# :background | |
# :border | |
# :link | |
# :text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to execute from home folder | |
wget http://snowball.tartarus.org/dist/libstemmer_c.tgz | |
wget http://sphinxsearch.com/files/sphinx-2.1.2-release.tar.gz | |
tar -xvzf sphinx-2.1.2-release.tar.gz | |
tar -xvzf libstemmer_c.tgz | |
cp -R libstemmer_c/* sphinx-2.1.2-release/libstemmer_c/ | |
cd sphinx-2.1.2-release/ | |
./configure --with-libstemmer | |
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
P = programmer; NP = non-programmer | |
NP: How long will it take? | |
P: It'll take as long as it takes. | |
NP: I don't understand. What does that mean? | |
P: When you tell me that the product is finished, it's done. | |
NP: You mean you can't estimate how long it'll take? | |
P: I can't estimate when you'll decide that it is done, therefore an | |
accurate prediction is impossible. From experience I know that a | |
project like this can take from three to nine months. A lot |
OlderNewer