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
# http://blog.vuzit.com/2008/08/01/paypal-website-payments-pro-us-with-recurring-billing-and-activemerchant/ | |
# The MIT License | |
# | |
# Copyright (c) 2008 Vuzit.com, Chris Cera, Tobias Luetke | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby | |
require 'rubygems' | |
require 'zerigo_dns' | |
require 'route53' | |
Zerigo::DNS::Base.user = 'username@email.com' | |
Zerigo::DNS::Base.api_key = 'yourkeyhere' | |
# iterate through all domain names |
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
{ scopeName = 'source'; | |
patterns = ( | |
{ name = 'source.invalid.trailing-whitespace'; | |
match = '((?<=[^\s\t])[\t\s]*)$'; | |
captures = { 1 = { name = 'invalid.trailing-whitespace'; }; }; | |
}, | |
); | |
} |
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
sudo vim /Library/LaunchDaemons/org.redis.redis-server.plist | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.redis.redis-server</string> | |
<key>Program</key> |
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 'erb' | |
@user = "Zach" | |
template = <<-TEMPLATE | |
Howdy <%= @user %>! | |
TEMPLATE | |
ERB.new(template).result(binding) |
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 Hash | |
def requires!(*args) | |
args.flatten.each do |arg| | |
raise ArgumentError, "#{arg} is required" unless has_key?(arg) | |
end | |
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
task :generate_static_pages => :environment do | |
ActionController::Dispatcher.define_dispatcher_callbacks(true) # same as config.cache_classes = true | |
class PreGenerateController < ApplicationController | |
layout 'secure' | |
def show | |
render :action => params[:id] | |
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
# requires rails environment to be loaded | |
include ActionView::Helpers::UrlHelper | |
include ActionController::UrlWriter | |
include ActionView::Helpers::TagHelper | |
default_url_options[:host] = 'www.website.com' |
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
alias ss="/rails/.shortcuts/ss.rb" |
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 ruby | |
require 'rubygems' | |
require 'daemon-spawn' | |
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
class DelayedJobWorker < DaemonSpawn::Base | |
def start(args) | |
ENV['RAILS_ENV'] ||= args.first || 'development' | |
Dir.chdir RAILS_ROOT |
NewerOlder