named_scope
in 2.x.
named_scope :active, :conditions => { :status => "activo" }
Just scope
now.
scope :active, where( :status => "activo" )
#!/bin/bash | |
### ABOUT | |
### Runs rsync, retrying on errors up to a maximum number of tries. | |
### Simply edit the rsync line in the script to whatever parameters you need. | |
# Trap interrupts and exit instead of continuing the loop | |
trap "echo Exited!; exit;" SIGINT SIGTERM | |
MAX_RETRIES=50 |
#!/bin/sh -e | |
# | |
# Usage: browser | |
# pipe html to a browser | |
# e.g. | |
# $ echo '<h1>hi mom!</h1>' | browser | |
# $ ron -5 man/rip.5.ron | browser | |
if [ -t 0 ]; then | |
if [ -n "$1" ]; then |
#!/bin/sh | |
# Last Change: 2011/10/06 | |
# apt-fast v0.02 by Matt Parnell http://www.mattparnell.com, this thing is fully open-source | |
# if you do anything cool with it, let me know so I can publish or host it for you | |
# contact me at admin@mattparnell.com | |
# Special thanks to Travis/travisn000 from the PCLinux Forums for making improvements that allow | |
# for more complex apt-get commands. See the thread: http://www.pclinuxos.com/forum/index.php/topic,66385.0.html | |
# adicionar suporte aos metalinks no aria2: http://ubuntuforums.org/showthread.php?t=1493421 | |
# veja também apt-metalink: http://github.com/tatsuhiro-t/apt-metalink |
#!/usr/bin/python | |
# redict - redis based dictionary | |
# this version uses UserDict and a mostly cached redis data for low I/O impact | |
# almost always consistent dict. to make sure you have all latest data run __sync() periodically | |
# gleicon 2010 - http://zenmachine.wordpress.com - http://github.com/gleicon - http://7co.cc | |
import redis | |
from UserDict import UserDict | |
import time |
function error_message { | |
echo -e >&2 \ | |
"---------------------------------------------------------------------------------------------------------" \ | |
"\n$1" \ | |
"\n---------------------------------------------------------------------------------------------------------" | |
} | |
function undo_merge { | |
error_message "Undoing your merge. Please fix the problem and try again." |
# Usage: reload-db /path/to/sqldump dbname | |
function reload-db { | |
for f in "$1"/*.sql; do | |
printf "%-${COLUMNS}s" "$f">&2; | |
cat "$f"; | |
done \ | |
| pv -s `du -sb "$1" | awk '{print $1}'` \ | |
| mysql -uroot "$2"; | |
if [ $? != 0 ]; then echo 'ERRORS!!!!!!!!!!!!!'; return $?; fi |
[diff "ruby"] | |
wordRegex = (@@?|\\b:|[^:]:)?[[:alnum:]_]+|:\"[^\"]+\"|::|[^[:space:]] | |
[diff "php"] | |
wordRegex = \\${0,2}[[:alnum:]_]+|::|->|[^[:space:]] |
[core] | |
excludesfile = /Users/ian/.gitignore | |
[color] | |
ui = auto | |
[alias] | |
co = checkout | |
st = status | |
br = branch | |
ci = commit | |
m = checkout master |
# Cumulative totals of lines added/deleted | |
git log --numstat STARTING_HASH..ENDING_HASH -M | grep '^[0-9]\+[[:space:]]\+[0-9]\+[[:space:]]' | awk '{added+=$1} {deleted+=$2} END { print added, deleted }' |