Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View scottburton11's full-sized avatar

Scott Burton scottburton11

View GitHub Profile
class GeocodesProfile
def self.for_profile(profile, geocoder = PostalGeocoder)
new(profile, geocoder).perform
end
attr_reader :profile
def initialize(profile, geocoder = PostalGeocoder)
@profile = :profile
end
<html>
<head>
<script src="javascripts/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="javascripts/ember.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
App = Ember.Application.extend();
App.Node = Ember.Object.extend({
name: null,
@scottburton11
scottburton11 / gist:1479734
Created December 15, 2011 03:43
Ember.js tree
<html>
<head>
<script src="javascripts/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="javascripts/ember.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
App = Ember.Application.extend();
App.Node = Ember.Object.extend({
name: null,
Paypal is generally a very poorly-designed product. It has evolved badly over the years, and today stands out as anachronistic and backward-looking compared to its competitors.
I have used PayPal as a customer, as a seller and as a developer, and I can confidently say that the experience is among the worst I've had in each category. As a professional web application developer, I would turn down any work that required me to integrated PayPal as a payment solution, and I actively warn my customers against relying on PayPal as a provider. I usually only need to explain that PayPal is expensive and difficult to integrated compared to the alternatives, but if pressed I will offer anecdotes about PayPal's awful consumer experience and customer service.
This latest interaction, which prompted this chain of customer support disasters, centers around two things: PayPal's inept user experience design, which prompts users to "Complete your purchase" on a screen that will only ever reject your purchase, and PayPal's
@scottburton11
scottburton11 / gist:849632
Created March 1, 2011 18:46
MongoDB indexed range query slower?
> db.ip_blocks.find({start_address: {$lte: 1665637698}, end_address: {$gte: 1665637698}}).explain()
{
"cursor" : "BasicCursor",
"nscanned" : 3662284,
"nscannedObjects" : 3662284,
"n" : 1,
"millis" : 2645,
"indexBounds" : {
}
@scottburton11
scottburton11 / gist:811583
Created February 4, 2011 19:17
Mongoid related scopes in inherited models - fails in RC1
class Business
include Mongoid::Document
references_many :cleanliness_ratings
...
end
class Rating
include Mongoid::Document
referenced_in :business
scope :good, :where => {:score.gte => 7}
require 'mongoid'
require 'sunspot'
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db("geo_near_with_boost")
end
class Hoobatz
include Mongoid::Document
field :name
cloud start
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /Library/Ruby/Gems/1.8/gems/poolparty-1.4.0/bin/../lib/poolparty/cloud.rb:141: syntax error, unexpected ',', expecting '|' (SyntaxError)
define_method meth.to_sym do |*args, &block|
^
/Library/Ruby/Gems/1.8/gems/poolparty-1.4.0/bin/../lib/poolparty/cloud.rb:290: syntax error, unexpected kEND, expecting $end
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/poolparty-1.4.0/bin/../lib/poolparty.rb:50
from /Library/Ruby/Gems/1.8/gems/poolparty-1.4.0/bin/../lib/poolparty.rb:47:in `each'
from /Library/Ruby/Gems/1.8/gems/poolparty-1.4.0/bin/../lib/poolparty.rb:47
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'