Skip to content

Instantly share code, notes, and snippets.

View calebhaye's full-sized avatar

Caleb Adam Haye calebhaye

View GitHub Profile
calebhaye / Garden.ino
Last active August 29, 2015 13:59
Arduino Garden
View Garden.ino
/* Pin Locations */
const int pinLightSensor = A1; // light sensor (analog 1)
const int pinThermistor = A2; // thermistor (analog 2)
const int pinRelayLED = 2; // relay LED (digital 2)
const int pinRelay = 3; // relay (digital 3)
const int pinMotionSensor = 5; // motion sensor (digital 5)
const int pinRangeSensor = 7; // range sensor (digital 7)
const int pinLED = 13; // LED (digital 13)
/* Globally scoped variables */
# This hook does two things:
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
calebhaye / .gems
Created April 21, 2012 07:13 — forked from rmanalan/.gems
Static websites using Heroku
View .gems
calebhaye / gist:3726057
Created September 15, 2012 02:09
Sample Textile
View gist:3726057
h2{color:green}. This is a title
h3. This is a subhead
p{color:red}. This is some text of dubious character. Isn't the use of "quotes" just lazy writing -- and theft of 'intellectual property' besides? I think the time has come to see a block quote.
bq[fr]. This is a block quote. I'll admit it's not the most exciting block quote ever devised.
Simple list:
calebhaye / pdf_helper.rb
Created October 24, 2012 17:23
Generating PDFs with wicked_pdf
View pdf_helper.rb
module PdfHelper
require 'wicked_pdf'
def self.included(base)
base.class_eval do
alias_method_chain :render, :wicked_pdf
def render_with_wicked_pdf(options = nil, *args, &block)
calebhaye / extract_fixtures.rake
Created January 8, 2013 07:01
Create YAML test fixtures from data in an existing database.
View extract_fixtures.rake
desc 'Create YAML test fixtures from data in an existing database.
Defaults to development database. Set RAILS_ENV to override.'
task :extract_fixtures => :environment do
sql = "SELECT * FROM %s"
skip_tables = ["schema_info"]
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
i = "000""#{Rails.root}/test/fixtures/#{table_name}.yml", 'w') do |file|
# see -
# get latest from master
git pull origin master
# set "current feature" variable and create feature branch
export CURRENT_FEATURE=1234567-feature-name
git checkout -b $CURRENT_FEATURE
# or use the following to get the current branch name
CURRENT_FEATURE=$(git symbolic-ref -q HEAD)
View PruneResqueWorkers.rb
Resque.workers.each {|w| w.unregister_worker }
View README.markdown

Twitter Bootstrap Components Helper

Provides an accordion helper and a tabs helper

In your Gemfile:

gem 'bootstrap-components-helpers', :git => 'git://'

Accordion helper: