Skip to content

Instantly share code, notes, and snippets.

View gary's full-sized avatar
🌐
Working from home

Gary Iams gary

🌐
Working from home
View GitHub Profile
# by bryan helmkamp with slight modification by chris wanstrath
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow
# I DO NOT RECOMMEND USING THIS WORKFLOW - IT DESTROYS HISTORY! - jesse andrews
module GitCommands
extend self
def diff_staging
`git fetch`
#!/usr/bin/ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = '/opt/local/bin/ctags'
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'
@gary
gary / blueprints.rb
Created November 9, 2011 03:25
Current week...
Timecop.freeze(Time.local(2011, 11, 8, 12, 0, 0))
start = Time.now - 2.days
finish = Time.now + 5.days
LeadAssignmentPeriod.blueprint do
start_date { start }
end_date { finish }
end

Product management has come up with the idea of allowing website users to leave reviews and ratings for listings. This feedback will be entered similar to how leads are submitted, but the user must enter the following information:

  • name
  • email address
  • phone number
  • rating from 1 to 5
  • optional review

In addition to the above information, a CAPTCHA presenting three different apartment complexes (only one of which is correct) is used in conjunction with the user’s name and phone number to determine whether or not the user actually lived at the listing. After validating and verifying the information, the user gets redirected to a thank you page. After a review is successfully submitted, it will show up as the first entry in the reviews for the listing. Pre-existing “certified resident” reviews will be integrated along with reviews that are submitted through the site. On the search results page, users can sort on rating type or filter on review type and rating. A link on each listing will take the us