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

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

module Listing
class Shared
include Virtus
attribute :addressline1, String
attribute :agappointmentactive, String
attribute :attuverse, String
attribute :avgoverallrating, String
attribute :brighthouse, String
attribute :charter, String
@gary
gary / export_my_mile_marker.rb
Created May 7, 2013 01:57
MyMileMarker CSV exporter
require 'csv'
require './my_mile_marker.rb' # https://gist.github.com/jnunemaker/83431
client = MyMileMarker::Client.new('email@domain.com', 'secret')
vehicle = MyMileMarker::Vehicle.new(client, 'car')
histories = vehicle.histories
CSV.open('./mileage.csv', 'w') do |csv|
csv << %w(odometer gallons price fuelup_date)
In which Gary goes through the following:
* How to setup AG's Cucumber suite
* How to run AG's Cucumber suite
* Helpful hints for working with the Drivers he chose
* Educational resources I hand-picked for distribution to their devs:
- 30 minute "Quick start" intended for everyone
- 2-3 hour, 401 level "Hole hog" guide intended for the quality overseer
* Walkthrough of writing a (passing) Cucumber Scenario
def get_saved_searches(zid)
<<<<<<< HEAD
begin
search_result = Zutron.get_searches(zid)
@searches = search_result if search_result.size > 0
rescue Zutron::Error
=======
search_result = Zutron.get_searches(zid)
if search_result
if search_result.size > 0
wiki_pages = wiki = Gollum::Wiki.new(tmp_dir).pages
wiki_pages.each do |wiki_page|
page_features = extract_features(wiki_page.raw_data)
write_feature_file(wiki_page.name, page_features) unless page_features.empty?
end
imgur
sass-mode scala-mode scss-mode
yaml-mode yasnippet)
@gary
gary / application.rb
Created April 2, 2012 23:23
StatsD/Rails setup, leveraging metaprogramming methods
# config/application.rb
# Bundler setup, etc.
module Example
class App
# ...
config.autoload_paths += %W(#{config.root}/extras)
@gary
gary / basic.rb
Created March 21, 2012 21:07
Machinist association declarations
Foo.blueprint :with_bars do
bars(3) # generates 3 'generic' Bar blueprints
# attr { sn }
end
@gary
gary / deploy.sh
Created February 2, 2012 19:49
A Blackberry deployment hammer if there ever was one
#!/bin/sh
# $1 should be the subdomain of the client to deploy
if [ ! $1 ]; then
echo "enter a client subdomain to deploy"
exit 1
fi
if [ ! -f "../${1}.cod" ]; then
echo "client ${1} does not exist"