Skip to content

Instantly share code, notes, and snippets.

--- 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'
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}$/,
% 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]

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

require 'ostruct'
require 'money'
class Array
def sum
inject{|a,b| a+b }
end
end
TIMES = 1_000
class Alpha; end
module Foo
class Bravo; end
def self.go
Alpha.new # success
Bravo.new # success
Foo::Bravo.new # Fail
end
@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 SurveyInviter
def initialize(attributes = {})
@survey_manager = SurveyManager.new(
Survey.new(attributes[:survey]),
Sender.new(attributes[:sender])
)
@message_manager = MessageManager.new(
Message.new(attributes[:message]),
Recipients.new(attributes[:recipients])
)
MP Games enjoyed
- Monaco
- Magicka
- Civ 5
- League of Legends
MP Games, consider flawed
- Endless Space
- Awesomenauts
- Dungeon Defenders
Role Character Action Effect Reaction
Score Take a point from the pool
Cheat Take two points from the pool
Coup Lose seven points to reveal a character card. You must take this action if you have 10+ points.
Duke Calvin Rulechange Take three points from the pool. Block someone from Cheating.
Assassin Hobbes Pounce Take a three point penalty to reveal a character card.
Contessa Suzie Cannot be Pounced.
Captain Spaceman Spiff Fight! Take two points from another player. Cannot be Fought.
Ambassasdor Stupendous Man Master of Disguise Draw and swap up to two characters. Cannot be Fought.