Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Fairchild fairchild

  • Procore
  • California
View GitHub Profile
View Grep in Project.tmCommand
<?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
View gist:4380
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
View gist:16842
#!/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 Oct 17, 2008 — forked from jdhuntington/bugflow
shell script to assist in working with lighthouse and git
View bugflow
#!/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
View vhostit.sh
#!/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\
View gist:21182
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:
View canvas.html
<div id="player">
<canvas id="levels" width="145" height="24"></canvas>
</div>
View gist:65083
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"
View snippet.rb
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
View poolparty testing errors
#########
# Cloud configuration
.
./test
./test/clouds.rb
./test/plugins
pool :test do
cloud :app do
instances 2..5
You can’t perform that action at this time.