gem install thor
mkdir -p ~/vagrants && cd ~/vagrants
curl -LO https://raw.github.com/gist/1528832/vagrantify
chmod 755 vagrantify
./vagrantify init webserver
require 'paperclip/geometry' | |
module Paperclip | |
module ClassMethods | |
# Places ActiveRecord-style validations on the width of the file assigned. The | |
# possible options are: | |
# * +in+: a Range of pixels (i.e. +10..100+), | |
# * +less_than+: equivalent to :in => 0..options[:less_than] | |
# * +greater_than+: equivalent to :in => options[:greater_than]..Infinity | |
# * +message+: error message to display, use :min and :max as replacements | |
def validates_attachment_width name, options = {} |
# Monkey-patch LoadError's message to include the current $LOAD_PATH. | |
class LoadError | |
def initialize(*args) | |
super | |
@path = $LOAD_PATH.dup | |
end | |
def message | |
if $servlet_context && $servlet_context.get_init_parameter('rack.load.path.debug') == 'true' | |
$servlet_context.log("Current path:\n" + @path.join("\n")) |
def score(dice) | |
compute_singles(dice) + compute_triples(dice) | |
end | |
def compute_singles(diceRoll) | |
diceRoll.inject(0) do |result, roll| | |
result += single_value(roll) | |
end | |
end |
# cat config/trinidad.yml | |
--- | |
environment: production | |
port: 5000 | |
log: info | |
extensions: | |
daemon: | |
pid_file: /data/cloudstock_demo/current/tmp/pids/trinidad_cloudstock_demo.pid | |
jvm_args: '-Xmx2048m' |
#!/bin/bash | |
# | |
# Provides a function that allows you to choose a JDK. Just set the environment | |
# variable JDKS_ROOT to the directory containing multiple versions of the JDK | |
# and the function will prompt you to select one. JAVA_HOME and PATH will be cleaned | |
# up and set appropriately. | |
_macosx() | |
{ | |
if [ $(uname -s) = Darwin ]; then |
Last year I set up jessebuchanan.ca with an SSL certificate on Amazon S3 / CloudFront.
Now, it's time to renew the certificate.
The first time was fraught with peril, but I eventually got it working.
This time I will document the steps to renew the cert. Most steps for a new installation would be omitted.