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
<?php | |
/** | |
* Utility for catching PHP errors and converting them to an exception | |
* that can be caught at runtime | |
* @author Jason Hinkle | |
* @copyright 1997-2011 VerySimple, Inc. | |
* @license http://www.gnu.org/licenses/lgpl.html LGPL | |
* @version 1.0 | |
*/ | |
class ExceptionThrower |
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
# Downgrade to use old YAML parser | |
YAML::ENGINE.yamler = "syck" | |
# Lots of other stuff ..... |
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
# This way you can test your scripts in your localhost. It's like using the | |
# --mirror option without downloading all the needed resources, just the HTML. | |
# Add "-e robots=off" to be evil | |
# Add --continue so wget won't download already downloaded files | |
wget -r -N -E --convert-links --random-wait -l 3 --wait=2 --user-agent=" Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.1) Gecko/20100101 Firefox/6.0.12011-09-09 13:03:08" "URL-WEBSITE?and=1¶ms=2" |
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
# Neighborhoods from the Autonomous Capital City official ones and some not so. | |
TOWNS_CABA = Set.new ["Agronomía","Almagro","Balvanera","Barracas","Belgrano", | |
"Boedo","Caballito","Chacarita","Coghlan","Colegiales","Constitución","Flores", | |
"Floresta","La Boca","La Paternal","Liniers","Mataderos","Monserrat", | |
"Monte Castro","Nueva Pompeya","Núñez","Palermo,","Parque Avellaneda", | |
"Parque Chacabuco","Parque Chas","Parque Patricios","Puerto Madero","Recoleta", | |
"Retiro","Saavedra","San Cristóbal","San Nicolás","San Telmo","Vélez Sársfield", | |
"Versalles","Villa Crespo","Villa del Parque","Villa Devoto","Villa Gral. Mitre", | |
"Villa Lugano","Villa Luro","Villa Ortúzar","Villa Pueyrredón","Villa Real", | |
"Villa Riachuelo","Villa Santa Rita","Villa Soldati","Villa Urquiza","Abasto", |
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
# Replace the first ".less" with your extension and ".css.less" with the desired one | |
for i in `find . -type f`; do mv "$i" `basename -s .less "$i"`.css.less ; done |
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
:plain | |
[ | |
- @movies.each do |movie| | |
:plain | |
{ | |
"name":"#{movie.name}", | |
"description":"#{j(movie.description)}" | |
}, | |
] |
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
# Simple Start and Stop tasks for your Solr server. | |
# 1 - Download your Solr from http://www.apache.org/dyn/closer.cgi/lucene/solr/ and extract it somewhere | |
# 2 - Set the :solr_path with the full path to the Solr "example" dir | |
# | |
# NOTES: | |
# - sunspot_solr gem must be in your Gemfile | |
# - It will run the "example" Jetty-embed Solr server (start.jar) | |
# - It will automatically pick your project Solr config from your "project_path/solr" with the Sunspot schema and files. | |
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
service[monit]=x,x,x,/etc/init.d/monit restart,/usr/bin/monit,root |
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
0 - Read http://blog.databigbang.com/running-your-own-anonymous-rotating-proxies/ | |
1 - Install monit, haproxy, tor and delegated. | |
2 - Setup your environment in the setup.rb file | |
3 - Just run > ruby setup.rb | |
4 - ........... | |
5 - PROFIT! > http://www.southparkstudios.com/clips/151040/the-underpants-business |
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
def weak_assign_attributes(new_attributes) | |
new_attributes = new_attributes.stringify_keys | |
new_attributes = self.attributes.merge(new_attributes){|key, old_val, new_val| old_val.present? ? old_val : new_val}. | |
diff(self.attributes) | |
self.attributes = new_attributes | |
end |
OlderNewer