Skip to content

Instantly share code, notes, and snippets.

@jamie
jamie / feature_collection.rb
Created March 3, 2014 18:02
off the cuff spike at a per-account feature toggler
class FeatureCollection
def initialize(account)
@account = account
end
DEFAULTS = {
'currency' => 'cad',
'can_accept_credit_cards' => false,
#...
}
class Alpha; end
module Foo
class Bravo; end
def self.go
Alpha.new # success
Bravo.new # success
Foo::Bravo.new # Fail
end
require 'ostruct'
require 'money'
class Array
def sum
inject{|a,b| a+b }
end
end
TIMES = 1_000

The game is interesting, but is drowning in bugs. There's also quite a lot of inconsistency with story, NPC dialogue, and events that the player takes place in. To give a little insight as to why. Before the last 3 beta events, ESO placed you in a starting zone like any other MMORPG. This depended on your faction choice. Stros M'kai, Bleakrock, etc.

You would follow through the quests there and eventually end up in the mainland, where the actual game took place. About a few weeks before the game released, they completely scrapped this idea and made the player START in the main land, by passing the starter zones completely. Of course, this broke all the dialogue and new dialogue had to be written and recorded in less than 2 weeks before the full release.

By the time the game released, the Prophet (Voiced by Michael Gambon), had some of his dialogue changed to reflect the new decision to allow the player the ability to optionally return to the starting zone rather than start there. Unfortunately, he was given

% ruby chem.rb !10004
[[0, 7, 1, 4, 8, 3, 5, 9, 6, 2]]
Slot 0
[[1, 2, 3, 4, 5, 6, 7, 8, 9, 0], 1]
[[2, 1, 3, 4, 5, 6, 7, 8, 9, 0], 1]
[[3, 2, 1, 4, 5, 6, 7, 8, 9, 0], 2]
[[4, 2, 3, 1, 5, 6, 7, 8, 9, 0], 0]
[[5, 2, 3, 4, 1, 6, 7, 8, 9, 0], 1]
[[6, 2, 3, 4, 5, 1, 7, 8, 9, 0], 1]
CARD_COMPANIES = {
'visa' => /^4\d{12}(\d{3})?$/,
'master' => /^(5[1-5]\d{4}|677189)\d{10}$/,
'discover' => /^(6011|65\d{2}|64[4-9]\d)\d{12}|(62\d{14})$/,
'american_express' => /^3[47]\d{13}$/,
'diners_club' => /^3(0[0-5]|[68]\d)\d{11}$/,
'jcb' => /^35(28|29|[3-8]\d)\d{12}$/,
'switch' => /^6759\d{12}(\d{2,3})?$/,
'solo' => /^6767\d{12}(\d{2,3})?$/,
'dankort' => /^5019\d{12}$/,
--- a/app/presenters/transaction_presenter.rb
+++ b/app/presenters/transaction_presenter.rb
@@ -35,7 +35,10 @@ class TransactionPresenter
:prefix => true, :allow_nil => true
def capture_response
- @capture_response ||= CreditCardGatewayRequest.from_transaction_token(token)
+ @capture_response ||= CreditCardGatewayRequest.where(
+ :transaction_token => token,
+ :method => 'capture'

The snow has begun to fall in King Landing, the Maesters have sent out the great white ravens. This long, bloody summer is at an end. A great man once said the "The Starks are always right eventually", and that rings more true than ever before.

A dead boy has landed upon the eastern shore and has proclaimed himself a king. Some may believe it is true, although they are fools. Black or red, the boy has done nothing and is nothing. Those who flock to him are doing it in hopes he can warm them once the cold winds reach south. He will proclaim Blood and Fire, and Blood will surely be shed in his name. But it is the Fire he lacks, and without that, the Blood will surely freeze.

Another boy who claims-to-be-King sits upon the Iron Throne. A bastard in truth, who cannot hope to survive the cold. In the summer warmth, a boy who smells of roses can be king, provided his gold is good. But in the Winter, roses wilt and die, and summer's gold cannot buy Winter's favor. The lion cub will surely perish in the cold, shive

@jamie
jamie / gist:b88269dbcec98fe2c6f6
Last active August 29, 2015 14:02
Tales of Honor
Level 1: 0
Level 2: 7,000
Level 3: 18,000 IV.0
Level 4: 33,000 IV.1
Level 5: 52,000 ?
Level 6: 75,000 IV.3
Level 7: 102,000 IV.4
Level 8: 132,000 IV.4, IV.1
Level 9: 168,000 IV.4, IV.3
Level10: 207,000 IV.4, IV.4
@jamie
jamie / download.rb
Last active September 13, 2023 21:55
Downloads 1080p wallpapers for Steam cards, using http://www.steamcardexchange.net/index.php?showcase as an index
# INSTALLATION
# Requres ruby 1.9+, and the nokogiri gem (gem install nokogiri)
# Should work fine on Windows, Mac, Linux
# Also needs a working curl, so windows users might need to do some work there.
# USAGE
# Hit up the game you want to scrape from Steam Card Exchange, like so:
# http://www.steamcardexchange.net/index.php?gamepage-appid-440
# Then, referencing the app ID in the url, run this script:
# ruby download.rb <appid>