Skip to content

Instantly share code, notes, and snippets.

View taylor's full-sized avatar
🐢
🌊

Taylor Carpenter taylor

🐢
🌊
View GitHub Profile
@taylor
taylor / Demo of setting up a remote git repo
Created January 22, 2009 23:13
Demo of setting up a remote git repo
This is a demo of steps seen in
http://toolmantim.com/articles/setting_up_a_new_remote_git_repository
** Setup remote repo
taylorwired:~ taylor$ ssh panda
Last login: Sat Jan 10 19:46:44 2009 from taylorwired.home
[taylor@panda ~]$ mkdir testme.git
[taylor@panda ~]$ cd testme.git/
[taylor@panda testme.git]$ git --bare init
" ---------------------------------------------------------------------------
" Settings for gist.vim
if has("mac")
let g:gist_clip_command = 'pbcopy'
end
let g:gist_detect_filetype = 1
@taylor
taylor / task1.rb
Created January 26, 2009 08:35
throw away idea code for task notes
require 'date'
class Task
@note = nil
def note=(s, action=nil)
if @note.nil?
@note = Note.new(s)
elsif action.nil?
@note.modify(s)
else
class PushupRoutine
attr_accessor :slowreps, :fastreps, :defspeed, :inc, :inc_when
alias increment :inc
def initialize(opts={})
@defspeed = opts[:speed] || "fast"
@slowreps = opts[:slow] || 1
@fastreps = opts[:fast] || 1
@inc = opts[:inc] || 0
@repsets = []
require 'pushuproutine'
require 'spec/expectations'
@pr=nil
Given /^I have an empty routine$/ do
@pr = PushupRoutine.new
end
When /^I add a set with (\d+) (\w+) reps for the first set$/ do |reps, speed|
Feature: Add set to a push up routine
A routine consists of n sets
A set contains x reps
The number of reps can be different for each set and should be specified
Sets are added in the order they are given
Scenario: Add four sets w/one slow rep for the 1st and five fast reps for the other three sets
Given I have an empty routine
When I add a set with 5 slow reps for the first set
And then I add a 3 more sets with 10 fast reps each
@taylor
taylor / gist:54463
Created January 29, 2009 08:14
doexpose
#!/bin/sh
EXPOSE_KEY="Print"
# skippy has to be started
# TODO: check for skippy
if [ -f /usr/bin/xmacroplay-keys ] ; then
xmacroplay-keys :0 $EXPOSE_KEY > /dev/null 2>&1
fi
# This has code is now in my snippets repo
# http://github.com/taylor/snippets
#
# Extending any? functionality just for fun
# New features:
# * :odd and :even args will test for duh odd and even for any element
# * The ability to pass multiple conditions to match on (logical OR. eg.
# it stops on the first postive/true match otherwise falls thru to false).
# * The ability to pass any type of closure not just implicity block
# * Any other argument is treated like those to include?
Global setup:
Download and install Git
git config --global user.email EMAIL_ADDRESS
Next steps:
mkdir PROJECT_NAME
cd PROJECT_NAME
git init
touch README
git add README
# So I bought this PDF book on ActiveMerchant from Peepcode.
# It's tests use Test::Unit, I was using RSpec. So I translated them.
# http://peepcode.com/products/activemerchant-pdf
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
include ActiveMerchant::Billing
describe OrderTransaction do
before do
@amount = 100