Skip to content

Instantly share code, notes, and snippets.

View fairchild's full-sized avatar

Michael Fairchild fairchild

  • Procore
  • California
View GitHub Profile
@fairchild
fairchild / Grep in Project.tmCommand
Created August 7, 2008 02:19 — forked from lmarlow/Grep in Project.tmCommand
textmate grep in project bundle
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>bundleUUID</key>
<string>5A9D4FC6-6CBE-11D9-A21B-000D93589AF6</string>
<key>command</key>
<string>#!/usr/bin/env ruby -rcgi
def parameterize(xml)
xml.gsub!('{iterator}', iterator_id.blank? ? 'Start' : 'Continue')
xml.gsub!('{iterator_id}', iterator_id || '')
xml.gsub!('{from_modified_date}', ((transactions_last_synced_on || 10.years.ago) - 1.day).to_s(:qb_date))
xml.gsub!('{to_modified_date}', (Time.now + 1.day).to_s(:qb_date))
xml
end
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'fileutils'
require 'yaml'
# TODO
# - pulling a specific UUID/Tag (gitspec hash) with clone/update
# - a 'deploy' task (in addition to 'redeploy' ?)
# - add merb:gems:refresh to refresh all gems (from specifications)
@fairchild
fairchild / bugflow
Created October 17, 2008 13:57 — forked from jdhuntington/bugflow
shell script to assist in working with lighthouse and git
#!/usr/bin/env ruby
# 2008.10.03
# JD Huntington
# shell script to assist in working with lighthouse and git
# requires lighthouse api ruby wrapper from http://github.com/Caged/lighthouse-api/tree/master
LIB_DIR='~/lib' # Absolute location of lighthouse.rb and lighthouse-api.rb
TOKEN='' # Insert your lighthouse token
ACCOUNT='' # Insert your lighthouse account name
#!/bin/sh
# VHostit
# Simple bash script to add a virtual host to apache & your hosts file on OS X
#
# Installation
# Throw vhostit.sh somewhere in your path. I like to copy it to /usr/local/bin/vhostit
# Usage
# `vhostit domain.tld` from within the directory you want to host.
# The domain.tld will be added to your hosts file and a VirtualHost added to your apache's httpd.conf\
@fairchild
fairchild / gist:21182
Created October 30, 2008 23:46 — forked from bakkdoor/file.rb
f = File.new("myfile.txt", "r") # open a file with read-mode
# ... do some stuff with the file, like read its content, ouput it on the screen or whatever
# finally: close it!
f.close
# or:
<div id="player">
<canvas id="levels" width="145" height="24"></canvas>
</div>
def any_verb(path, block)
get path, &block
post path, &block
put path, &block
delete path, &block
head path, &block
end
any_verb "/" do
"foo"
class Pop
def initialize(h={}, &block)
options(h)
puts "indide #{self.class} #{options.inspect}"
instance_eval &block if block
end
def self.default_options(h={})
@default_options ||= h
end
#########
# Cloud configuration
.
./test
./test/clouds.rb
./test/plugins
pool :test do
cloud :app do
instances 2..5