This file contains hidden or 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
| # Uncomment these lines to debug Log4r | |
| # trouble = Log4r::Logger.new('log4r') | |
| # trouble.add Log4r::Outputter.stdout | |
| # assign log4r's logger as rails' logger. | |
| log4r_config = YAML.load_file(File.join(File.dirname(__FILE__), "..", "log4r_#{Rails.env}.yml")) | |
| log_cfg = Log4r::YamlConfigurator | |
| log_cfg["ENV"] = Rails.env | |
| log_cfg["HOST"] = `hostname`.to_s.gsub(/\n$/, "") | |
| log_cfg["APPNAME"] = Rails.application.class.parent_name |
This file contains hidden or 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
| namespace :memcached do | |
| desc "List valid keys that haven't expired" | |
| task list_valid_keys: [:environment] do | |
| # List all keys stored in memcache. | |
| # Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
| require 'net/telnet' | |
| # overload so we don't have to worry about unmarshaling | |
| module Marshal |
This file contains hidden or 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
| #!/bin/bash | |
| username="root" | |
| password="root" | |
| mysql="/Applications/MAMP/Library/bin/mysql" | |
| mysqldump="/Applications/MAMP/Library/bin/mysqldump" | |
| date=`date +%Y-%m-%d_%H-%M-%S` | |
| output_folder="$HOME/Projects/mysql_backup" | |
| show_databases="$mysql -u $username -p$password -e 'show databases'" |
This file contains hidden or 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
| # The following snippet handles any calls to ap or awesome_print hanging out in your code, | |
| # which can be particularly troublesome in a production environment where awesome_print isn't | |
| # included in your Gemfile. | |
| # If you have any inline "ap" or "awesome_print" calls, they will be aliased to | |
| # puts (not using the alias method, that wasn't optimal). The output will also be logged at | |
| # info level (feel free to change this depending on your needs) with the calling file and | |
| # line number so you can find the offending calls. | |
| # You can grep through your log files for "[ AP called from " to find any calls to ap. |