Skip to content

Instantly share code, notes, and snippets.

View steveburkett's full-sized avatar

Steve Burkett steveburkett

View GitHub Profile
@steveburkett
steveburkett / gist:3cd8a069904a65de6aa2
Created June 5, 2014 19:22
Redis::InheritedError stack trace
M_ROOT]/gems/redis-3.0.7/lib/redis/client.rb:299:in `ensure_connected`
[GEM_ROOT]/gems/redis-3.0.7/lib/redis/client.rb:191:in `block in process`
[GEM_ROOT]/gems/redis-3.0.7/lib/redis/client.rb:270:in `logging`
[GEM_ROOT]/gems/redis-3.0.7/lib/redis/client.rb:190:in `process`
[GEM_ROOT]/gems/redis-3.0.7/lib/redis/client.rb:96:in `call`
[GEM_ROOT]/gems/redis-3.0.7/lib/redis.rb:1206:in `block in sadd`
[GEM_ROOT]/gems/redis-3.0.7/lib/redis.rb:37:in `block in synchronize`
/usr/lib64/ruby/2.0.0/monitor.rb:211:in `mon_synchronize`
[GEM_ROOT]/gems/redis-3.0.7/lib/redis.rb:37:in `synchronize`
[GEM_ROOT]/gems/redis-3.0.7/lib/redis.rb:1205:in `sadd`
@steveburkett
steveburkett / gist:88b0aaf2d0c6a513b95b
Created June 5, 2014 19:09
/data/reputation/shared/config/unicorn.rb
# Set variables for usage in the before_exec block to help ensure deploys are succesful.
current_path = '/data/reputation/current'
shared_path = '/data/reputation/shared'
shared_bundler_gems_path = "/data/reputation/shared/bundled_gems"
working_directory '/data/reputation/current/'
# sets the current number of worker_processes to +nr+. Each worker
# process will serve exactly one client at a time. You can
# increment or decrement this value at runtime by sending SIGTTIN
# or SIGTTOU respectively to the master process without reloading
Given:
Organization
has_one :plan, dependent: :destroy, inverse_of: :organization
validates_presence_of :name, :plan
Plan
belongs_to :organization, inverse_of: :plan
validates :organization, :type, presence: true
require "spec_helper"
module TimeZoneTestHelper
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
{
"debug_info" => [],
"html_attributions" => [],
"result" => {
"address_components" => [
[0] {
"long_name" => "Provo",
"short_name" => "Provo",
"types" => [
[0] "locality",
@steveburkett
steveburkett / google places detail API call
Last active December 21, 2015 21:38
Monterra Apartments 1333 N 24th St Phoenix, AZ 85008 Plus URL: https://plus.google.com/104682086520694271755/about?gl=US&hl=en-US
[15] pry(main)> details
{
"debug_info" => [],
"html_attributions" => [],
"result" => {
"address_components" => [
[0] {
"long_name" => "Monterra Apartments",
"short_name" => "Monterra Apartments",
"types" => [
class Middleware::Caring::Api
include HTTParty
#debug_output $stdout
base_uri 'dir.caring.com'
format :json
RESOURCE = '/api/v1/reviews/feed.json'
PID = 'fb0487e0'
<<<<<<< HEAD
def self.update_location_google_places_listing(location, place_details_data)
business_listing = location.google_places_listing
business_listing.average_rating = place_details_data.result.rating
business_listing.url = place_details_data.result.url
business_listing.save
end
# @params Location location the location being updated
# @params String search_result the google places search api result,
<<<<<<< HEAD
it "should update location google+ listings" do
location = Location.new
biz_listing = BusinessListing.new
location.stub(:google_places_listing).and_return(biz_listing)
biz_listing.should_receive(:save)
place_details = stub(:result => stub({:rating => 3, :url => "foo.com"}))
Search::LocationFactory.update_location_google_places_listing(location, place_details)
biz_listing.url.should == "foo.com"
[3] pry(Location)> places_detail_search
#<Middleware::GooglePlaces::PlacesDetailSearch:0x007f98614c3af0
@key="places-detail-searches:776aab04dfe55af47d74e006d82468d8",
@raw_result={"address_components"=>[{"long_name"=>"2130", "short_name"=>"2130", "types"=>["street_number"]}, {"long_name"=>"Post St", "short_name"=>"Post St", "types"=>["route"]}, {"long_name"=>"Lower Pacific Heights", "short_name"=>"Lower Pacific Heights", "types"=>["neighborhood", "political"]}, {"long_name"=>"San Francisco", "short_name"=>"SF", "types"=>["locality", "political"]}, {"long_name"=>"San Francisco", "short_name"=>"San Francisco", "types"=>["administrative_area_level_2", "political"]}, {"long_name"=>"California", "short_name"=>"CA", "types"=>["administrative_area_level_1", "political"]}, {"long_name"=>"United States", "short_name"=>"US", "types"=>["country", "political"]}, {"long_name"=>"94115", "short_name"=>"94115", "types"=>["postal_code"]}], "adr_address"=>"<span class=\"street-address\">2130 Post St</span>, <span class=\"lo