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 'builder' | |
class Sitemap | |
STATIC_URLS = ['/home/about', | |
'/home/help', | |
'/home/contact_us', | |
'/home/terms'] | |
class << self |
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
set :sync_directories, ["public/assets", "public/galleries"] | |
set :sync_backups, 3 |
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
# Rack::Test doesn't support hitting external webservers. However, when a user enters their credit card info, | |
# it is submitted directly to braintree, so we need to intregration test with hitting an external server. | |
# This hack enabled this, by swapping out the Rack::Test's rack app with a Rack::Client instance. | |
# Rack::Client acts just like a rack app, but under the covers it delegates to Net::HTTP. | |
require 'rack/client' | |
module RackTestHack | |
def new(*a, &b) |
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
# note - you may need to split into a before-deploy (stop) and after-deploy (start) depending on your setup | |
desc "Hot-reload God configuration for the Resque worker" | |
deploy.task :reload_god_config do | |
sudo "god stop resque" | |
sudo "god load #{File.join deploy_to, 'current', 'config', 'resque.god'}" | |
sudo "god start resque" | |
end | |
after 'deploy:update_code', 'deploy:update_shared_symlinks' |
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
# Enable upload_progress module for easy cross browser progress bar support | |
# using only javascript client side | |
upload_progress foobar_uploads 1m; | |
server { | |
# We only need one server block to deal with HTTP and HTTPS | |
# avoids duplication | |
listen 80; | |
listen 443 default ssl; | |
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
install PostgreSQL 9 in Mac OSX via Homebrew | |
Mac OS X Snow Leopard | |
System Version: Mac OS X 10.6.5 | |
Kernel Version: Darwin 10.5.0 | |
Install notes for PostgreSQL 9.0.1 install using Homebrew: | |
sh-3.2# brew install postgresql |
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 'rubygems' | |
require 'active_model' | |
class LegacyTable | |
include ActiveModel::Serialization | |
include ActiveModel::Serializers::JSON | |
include ActiveModel::Serializers::Xml | |
attr_accessor :nice_attribute, |
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
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
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
function onFormSubmit(e) { | |
var to_email = "YOUREMAIL@YOURCOMPANY.COM"; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var spreadsheet_name = ss.getName(); | |
var sheet = ss.getSheets()[0]; | |
var columns = sheet.getRange("A1:U1").getValues()[0]; | |
var email_subject = "New response for [" + spreadsheet_name + "]"; | |
var email_body = "Spreadsheet: " + spreadsheet_name + "\r\n\r\n"; | |
var email_body_html = "<p><b>Spreadsheet: " + spreadsheet_name + "</b></p>"; |
OlderNewer