Skip to content

Instantly share code, notes, and snippets.

View wbrady's full-sized avatar

Will Brady wbrady

  • Palantir
  • Washington, D.C.
View GitHub Profile
@agnoster
agnoster / README.md
Last active July 13, 2024 19:26
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@wbrady
wbrady / create-confluence-spaces.rb
Created March 29, 2013 18:54
Ruby script to create Confluence personal spaces for users who don't have one
#!/usr/bin/env ruby
require 'xmlrpc/client'
puts "Please enter your Confluence base URL:"
base = STDIN.gets.chomp
puts "Please enter your username:"
user_name = STDIN.gets.chomp
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active July 10, 2024 14:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

# app/resourceful_api/resourceful_actions.rb
# Requires #params, #render, Presenters::Api
module ResourcefulAction
def presents_json_endpoints(service, *actions)
respond_to :json
actions.each do |action|
define_method action do
resp = Presenters::Api.call(service,action, params)
render :json => resp, :status => resp[:status]