This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Faulty premise, lots of assumptions | |
I believe HookSlide is lacking the necessary facts to reach the conclusion that the voting is being hacked. | |
Let’s look at it from a technical perspective by pretending that we had to build the MLB voting website. I’m sure MLB would demand the following: | |
1) Voting must be valid and accurate. No hacking the vote! | |
2) The voting site must stand up to TONS of web traffic from around the world. No downtime! | |
3) It must be friendly for visitors to vote. Don’t scare people away! | |
Checking for valid votes is expensive, as it will require computation and many database lookups across millions of records. Combine that with making a real-time check as thousands of users from around the world are hitting your site… at the same time?!?!?! That’s a very hard problem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Background: | |
Given I have a table named Test | |
| Field | Value | | |
| x | y | | |
Scenario: | |
When I look at the Test Table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Binding] | |
class BoardSteps | |
{ | |
[When("there is a chess board set up as")] | |
public void a(Table table) | |
{ | |
rows = Table.ConvertToSet<BoardRow>(); | |
board = Board.new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Product | |
{ | |
public string Id { get; set; } | |
public string Name { get; set; } | |
// etc | |
public IQueryable<Product> All() | |
{ | |
MyIoCContainer.Resolve<DbContext>().Products(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
generic_track_id = '10' | |
xml = File.open('project.xml').read | |
doc = Nokogiri::XML xml | |
tracks = doc.xpath("//GenericTrack") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe ContactUsController do | |
let(:params) { {} } | |
let(:controller) do | |
c = ContactUsController | |
c.stubs(:params).returns params | |
c | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OldWorker | |
include Sidekiq::Worker | |
def perform user_event_id | |
user_event = UserEvent.find user_event_id | |
user = User.find user_event.user_id | |
user_application = user.find_application user_event.application_id | |
# do something | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am darrencauthon on github. | |
* I am darrencauthon (https://keybase.io/darrencauthon) on keybase. | |
* I have a public key whose fingerprint is 3D4B 591E 675D 0B41 AE95 EA86 0A23 A070 4250 4AE2 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CachingLayer | |
class << self | |
def method_missing meth, *args, &block | |
action = meth.to_s.split('_')[0].to_sym | |
object_id = args[0].is_a?(ActiveRecord::Base) ? args[0].id : args[0] | |
object_type = meth.to_s.sub("#{action}_", '').to_sym | |
case action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProductController : Controller | |
{ | |
private IProductRepository _productRepository; | |
public ProductController(IProductRepository productRepository) | |
{ | |
_productRepository = productRepository; | |
} | |
public ActionResult Index() |