Skip to content

Instantly share code, notes, and snippets.

View ben-gy's full-sized avatar
🏠
Working from home

Ben Richardson ben-gy

🏠
Working from home
View GitHub Profile
@ben-gy
ben-gy / gist:633bacb1be7255b217a5
Created February 10, 2016 07:05
Programming challenge freighter ship
You have been hired by a late 18th century naval shipping company who transport large quantities of gold.
They company has multiple ships, all capable of carry different amounts of gold.
The current shipping coordinator, known only as the Seawolf, has realised that their current shipping methods are inefficient and wishes to have a system to reduce the required trips for a given weight of gold.
Your task is to create a system that for a given set of ships, can transport a quantity of gold with the fewest possible trips. Each ship may only carry it's exact quantity. The company has multiple of each ship class.
For instance, with the following ship classes:
Captain Harrison is busy exploring Nifty's Loch. Unfortunately - he keeps getting lost. You decide to help him by building a positioning system that can be installed on his ship (The SS Reckoning).
Luckily, Nifty's Loch is a a perfect square, 10 units high and 10 units wide. With the docks positioned at (0,0).
As the ship moves or changes direction, it will send messages to your positioning system. These relate to the ship moving forwards or changing direction. For example:
F 4 - This will move the ship forward four units, not changing the direction the ship is pointing in. B 2 - This will move the ship backwards two units, not changing the direction the ship is pointing in. L 2 - This will rotate the ship 90 degrees left twice. L 2 then makes the ship point in the opposite direction, while L 4 does a complete 360 and point in the same direction. 'R 3' - This will turn the ship right 90 degrees, 3 times.
When the program receives the REPORT command, it should give it's current position, as well as the com

Amazon Web Services

This document provides a succinct description of product offered by Amazon Web Services (AWS). It's a working progress.


Compute

EC2

Virtual Servers in the Cloud

@ben-gy
ben-gy / devmethod.md
Last active January 17, 2016 04:35
How we develop as fast as a startup within the walls of a large corporate

PwC Shipyard Development Methodology

In Shipyard we try to minimise as much project management as possible. This is how we keep our team lean and nimble.

Tools

GitHub is our base of operations in which we've integrated some apps to help us run lean whilst delivering high quality code. Here are our integrations:

  • Circle CI for continuous development and deployment
  • Heroku for hosting (automatic deployments from master to staging - US & EU)
# Get all users' emails that signed in today
User.where(["last_sign_in_at > ?", 2.days.ago]).map(&:email)
## Installing nokigiri
### on Mavericks
brew install libxml2
bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
bundle install
### on Yosemite
brew install libxml2
bundle config build.nokogiri --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/