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
Delete large number of files: | |
ls|xargs -L 1000 rm | |
-- | |
Maintenace page for Rails | |
RewriteEngine on | |
RewriteCond %{DOCUMENT_ROOT}/../tmp/stop.txt -f |
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
// If you don't use underscore.js, use it (http://documentcloud.github.com/underscore/) | |
// Then, use underscore's mixin method to extend it with all your other utility methods | |
// like so: | |
_.mixin({ | |
escapeHtml: function () { | |
return this.replace(/&/g,'&') | |
.replace(/>/g,'>') | |
.replace(/</g,'<') | |
.replace(/"/g,'"') | |
.replace(/'/g,'''); |
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
# how to name keys in redis for keyvalue stores | |
http://code.google.com/p/redis/wiki/TwitterAlikeExample | |
http://rediscookbook.org/introduction_to_storing_objects.html | |
http://www.slideshare.net/playnicelyapp/redis-schema-design-for-playnicely-redis-london-meetup | |
antirez has a book about keyvalue design in the pipeline | |
http://code.google.com/p/redis/wiki/IntroductionToRedisDataTypes | |
schema: | |
<namespace>:<globalObject> |
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
# Rails 2 and Rails 3 console | |
function rc { | |
if [ -e "./script/console" ]; then | |
./script/console $@ | |
else | |
rails console $@ | |
fi | |
} |
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
require 'benchmark' | |
module Kernel | |
alias old_require require | |
def require(path) | |
#unless caller.find { |caller_line| caller_line.match /dependencies\.rb/ } | |
# return old_require(path) | |
#end |
NewerOlder