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
config.action_controller.asset_host = Proc.new { |source| | |
if source.starts_with?('/javascripts') || source.starts_with?('/stylesheets') | |
nil # bundle_fu friendly | |
else | |
"http://asset%d.domain.com" % ( (source.hash % 4) ) | |
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
#!/usr/bin/env bash | |
sudo cp -R $1 /usr/local/mysql/data/$1 | |
sudo chown -R _mysql /usr/local/mysql/data/$1 | |
sudo chmod -R 660 /usr/local/mysql/data/$1 | |
sudo chmod 750 /usr/local/mysql/data/$1 |
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
#!/usr/bin/env bash | |
# 2D dock | |
defaults write com.apple.dock no-glass -boolean YES | |
# highlight on mouse over | |
defaults write com.apple.dock mouse-over-hilte-stack -boolean yes | |
# spring load all dock items | |
defaults write com.apple.dock enable-spring-load-actions-on-all-items -boolean yes | |
# recent items stack | |
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }' |
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
#!/usr/bin/env bash | |
cd $1 && \ | |
find ./ -type f -name \geminstaller*.yml -exec sudo geminstaller -c {} \; |
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
#!/usr/bin/env bash | |
if [ -d sphinx-0.9.8.1 ]; then | |
rm -rf sphinx-0.9.8.1 | |
fi | |
if [ -e sphinx-0.9.8.1.tar.gz ]; then | |
rm sphinx-0.9.8.1.tar.gz | |
fi | |
curl -O http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz |
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 UrlEncodedPairParser < StringScanner #:nodoc: | |
attr_reader :top, :parent, :result | |
def initialize(pairs = []) | |
super('') | |
@result = {} | |
pairs.each { |key, value| parse(key, value) } | |
end | |
KEY_REGEXP = %r{([^\[\]=&]+)} |
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
#!/bin/sh | |
# | |
# This script starts and stops the Dj daemon | |
# This script belongs in /engineyard/bin/dj | |
# | |
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH | |
CURDIR=`pwd` | |
usage() { | |
echo "Usage: $0 <appname> {start|stop} enviroment [name maximum_priority minimum_priority]" |
Below is an example problem that necessitates research of Rails code. An appropriate answer should provide any resources you used to discover the answer as well as a written explanation of the cause and a possible patch.
Setup a test app with the basic dependencies: rails 2.3.4 -m http://gist.github.com/raw/241424/e5a2c6750ea5f2f8e798acfcdb5ba76d77f99c41/template.rb fdl_question
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
# == Schema Information | |
# | |
# Table name: geocode_results | |
# | |
# id :integer(4) not null, primary key | |
# query :string(255) | |
# address :string(255) | |
# lat :string(255) | |
# lng :string(255) | |
# created_at :datetime |
OlderNewer