Skip to content

Instantly share code, notes, and snippets.

View RookieOne's full-sized avatar

Jonathan Birkholz RookieOne

View GitHub Profile
End to end testing is a necessary evil. With unit tests, each part may work individually, but how can we know if they fit together?
But End to End tests are slow, unreliable, brittle, just terrible, and did I mention slow? Ugh!
Boom! Hello Nightwatch.js. Learn to write fast, reliable automated browser tests using Nighwatch.
Leveraging Nightwatch's awesomeness, we will jam out end to end tests for existing an app.
Check your perfectionist ideals at the door and be amazed at how fast our end to end tests are created and run.
@RookieOne
RookieOne / standards.js
Last active August 29, 2015 14:11
JB's JavaScript coding standards
// File Names
// lowercase separated by dashes
// not underscores because Node uses dashes for require()
// so using dashes for file names keeps with that standard
// lowercase because not all OS have case sensitive file names
// RIGHT
application.js
some-cool-controller.js
@RookieOne
RookieOne / gist:c778faa003411f1ddaa0
Created December 3, 2014 16:57
API Url Standard
Too many opinions. Too many white papers.
GET /things
returns collection of things
POST /things
adds an item to things
GET /things/100
returns a thing with id 100
@RookieOne
RookieOne / tiy_rails_day1
Last active August 29, 2015 14:06
Iron Yard Day 1 - Rails Homework
# Submit the homework by pasting the code in a gist and emailing JB the url to the gist
# Assign "Hello World" to a variable message
# Assign a different string to a different variable
# Assign a number to a variable
# Use string interpolation to display the number in a string
# string interpolation = #{}
@RookieOne
RookieOne / gist:7903276
Last active December 30, 2015 23:49
Blurst #1 2013 Calculate Position
class Trading::CalculatePosition
def self.execute(user, contender, options={})
position = user.positions.where(contender_id: contender.id).first
contracts = user.contracts
.select{|c| c.contender_id == contender.id}
.sort{|x,y| x.created_at <=> y.created_at }
if contracts.empty?
SurvivorContest.where("finalized = false and cancelled = false").each do |contest|
# do nothing
round = contest.active_round
if round.present?
if round.syncable?
round.match_ups.where(syncable: true).find_each do |match_up|
# do nothing
end
# round.match_ups.syncable.each do |match_up|
# SyncMatchUpWorker.queue(match_up.id, @options)
d3.select("#make-table")
.append("tr")
.selectAll("td")
.data(data)
.enter()
.append("td")
.text(function(d) {
return d.value;
});
string showAs = _defaultShowAs;
if (route.Contains(KnownParameters.ShowAs))
{
showAs = route[KnownParameters.ShowAs].ToString();
}
/// AND
public override bool CanProcessFilter(IRoute route)
[TestMethod]
public void should_set_parameter()
{
var message = new Message() as dynamic;
message.Foo = "foo";
var foo = message.Foo as string;
foo.ShouldBe("foo");
}
public interface ITranslator
{
}
public class ClientATranslator : ITranslator
{
}
public class ClientBTranslator : ITranslator
{