Skip to content

Instantly share code, notes, and snippets.

@bluemont
bluemont / alchemy_api.rb
Created July 10, 2012 05:34
AlchemyAPI wrapper
# Currently used in a Rails 3.2.6 application
#
# Notes:
# * add 'faraday' to your Gemfile
# * put this file in '#{Rails.root}/lib/alchemy_api.rb'
# * `export ALCHEMY_API_KEY="..."` in your shell
#
class AlchemyAPI
attr_accessor :api_key, :base_url
@bluemont
bluemont / chef_solo_bootstrap.sh
Created June 30, 2012 06:08 — forked from ijonas/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/usr/bin/env bash
sudo apt-get -y update
sudo apt-get -y upgrade
# a reboot after is often a good idea
sudo apt-get -y install build-essential libffi-dev libgdbm-dev libreadline6-dev libssl-dev libxml2 libxml2-dev libxslt-dev libyaml-dev ncurses-dev zlib1g zlib1g-dev
RUBY_VERSION="1.9.3-p194"
mkdir ~/src
cd ~/src
@bluemont
bluemont / url_validator.rb
Created June 25, 2012 04:27
ActiveModel URL Validator
class UrlValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
valid = begin
URI.parse(value).kind_of?(URI::HTTP)
rescue URI::InvalidURIError
false
end
unless valid
record.errors[attribute] << (options[:message] || "is an invalid URL")
@bluemont
bluemont / app_commentary.md
Last active October 5, 2015 21:28
App Commentary

App Commentary

This is mostly a list of Mac applications, but I've included a few Web apps as well.

Every-Day Awesomeness

Alfred : Useful Application Launcher. (When Quicksilver died I switched to Alfred.)

Divvy : Grid-Based Window Manager.