Skip to content

Instantly share code, notes, and snippets.

View aaronmoodie's full-sized avatar
Coffee

Aaron Moodie aaronmoodie

Coffee
View GitHub Profile
@aaronmoodie
aaronmoodie / gist:5401127
Last active December 16, 2015 07:48 — forked from dnch/gist:5392985
class Show < ActiveRecord::Base
attr_accessible :artist_tokens, :cost, :booking_url, :door_charge, :venue_id, :date, :time, :starts_at
attr_reader :artist_tokens, :date, :time
validate :is_time
validate :is_date
before_save :save_date_and_time
has_many :performances
has_many :artists, :through => :performances
@aaronmoodie
aaronmoodie / README.md
Created September 2, 2012 23:55 — forked from hongymagic/README.md
Simple zsh wrapper to launch iA Writer from the terminal

This is a simple script to launch iA Writer from the terminal. It is extremely useful for interacting with Github's own wiki system as it provides git access.

INSTALL

One-liner

curl -L https://raw.github.com/gist/3605724/efcccacb59e5df271ddf603ac92da4deee2440df/ia > /usr/local/bin/ia && chmod u+x /usr/local/bin/ia

Manual, safer way

@aaronmoodie
aaronmoodie / theme.html
Created April 17, 2012 22:55 — forked from soemarko/theme.html
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@aaronmoodie
aaronmoodie / config.ru
Created March 6, 2012 10:36
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
# The following lines should come as no surprise. Except by
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cross-browser kerning-pairs & ligatures</title>
<style>
body { font-family: sans-serif; background: rgba(30, 10, 0, 0.05); color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; }
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px; -webkit-transition: background 1s ease; }
a:hover { background: rgba(0, 220, 220, 0.2); }
p { line-height: 1.5; padding: 0px 1em 0em 0em; }