Skip to content

Instantly share code, notes, and snippets.

View zachhale's full-sized avatar
🚴‍♂️
Riding my bike

Zach Hale zachhale

🚴‍♂️
Riding my bike
View GitHub Profile
@zachhale
zachhale / goldfish_review.mkdn
Last active August 29, 2015 14:02
Goldfish Mac and Cheese Review

These will ruin your tastebuds

A review of Pepperidge Farm Goldfish Macaroni and Cheese

I bought this on a whim after having a lengthy conversation with my coworkers about an anonymous comment someone left on a survey tool we use where we wondered if their comment consisting of the word "goldfish" 7,200 times meant that they wanted a giant fish tank full of living goldfish or if they were actually requesting a large box of goldfish crackers. We think they mean't crackers.

I went to the store a few minutes later and what do you know, goldfish mac and cheese ON SALE! Fantastic, I'm buying that.

2 weeks later ... working from home, I figure why not, I'll try them.

# cell widths
cell_widths = [160,60]
# example data for rows_to_pdf
rows_to_pdf = [
['Row Name','200',300','400'],
['Row Name','200',300','400'],
['Row Name','200',300','400'],
['Row Name','200',300','400'],
['Row Name','200',300','400']
@zachhale
zachhale / .bashrc
Created January 15, 2009 01:49 — forked from henrik/.bashrc
Colored, w/out username
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
@zachhale
zachhale / gist:54861
Created January 30, 2009 00:55 — forked from peterc/gist:33337
# SUPER DARING APP TEMPLATE 1.0
# By Peter Cooper
# Link to local copy of edge rails
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' }
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
>> o = Object.new
=> #<Object:0x815c45c>
>> o.class
=> Object
>> Class.superclass.superclass
=> Object
>> Object.class
=> Class
# we have
admin.resources :meals do |meal|
meal.resources :preparation_steps
meal.resources :preparation_tools, :collection => {:associate => :post},
:member => {:disassociate => :delete}
end
# i've added a "sort" method to the preparation_steps controller, and need
# to access /admin/meals/:meal_id/preparation_steps/:preparation_step_id/sort
#!/usr/bin/env ruby
require 'rubygems'
require 'daemon-spawn'
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
class DelayedJobWorker < DaemonSpawn::Base
def start(args)
ENV['RAILS_ENV'] ||= args.first || 'development'
Dir.chdir RAILS_ROOT
alias ss="/rails/.shortcuts/ss.rb"
# requires rails environment to be loaded
include ActionView::Helpers::UrlHelper
include ActionController::UrlWriter
include ActionView::Helpers::TagHelper
default_url_options[:host] = 'www.website.com'
task :generate_static_pages => :environment do
ActionController::Dispatcher.define_dispatcher_callbacks(true) # same as config.cache_classes = true
class PreGenerateController < ApplicationController
layout 'secure'
def show
render :action => params[:id]
end
end