- Install stud
$ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
- Download and install the powssl script
$ curl https://raw.github.com/gist/2050941/3ea59efe8c7e9013c265313045a9fdda5c653963/powssl > ~/bin/powssl
$ chmod +x ~/bin/powssl
- Run powssl to create development certificate and configure stud.
$ powssl
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
class ApplicationController < ActionController::Base | |
TOKEN_PLACEHOLDER = "__CROSS_SITE_REQUEST_FORGERY_PROTECTION_TOKEN__" | |
after_filter :inject_csrf_token | |
private | |
def inject_csrf_token | |
if protect_against_forgery? && token = session['_csrf_token'] | |
if body_with_token = response.body.gsub!(TOKEN_PLACEHOLDER, token) |
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
#!/usr/bin/env ruby | |
# Usage: no_automount /Volumes/My\ Disk | |
if ARGV[0].nil? | |
puts "Usage: no_automount /Volumes/My\ Disk" | |
exit 1 | |
end | |
diskinfo = `diskutil info '#{ARGV[0]}'`.gsub("\n\n", "\n").split("\n").collect do |b| |