Skip to content

Instantly share code, notes, and snippets.

View lukepuplett's full-sized avatar

Luke Puplett lukepuplett

View GitHub Profile
@lukepuplett
lukepuplett / RoundRobin.cs
Created August 7, 2019 17:31
How to round robin writing to an array
int length = 10;
var numbers = new int[length];
int r = 0;
for (int i = 0; i < 100000; i++)
{
r = unchecked(r + 1);
numbers[r % length] = r;
}
class Program
{
private static string baseAddress = "http://localhost:5000/api";
static async System.Threading.Tasks.Task Main(string[] args)
{
var journey = new JourneyBuilder(new Uri(args.FirstOrDefault() ?? baseAddress));
var discountDetails = new AddDiscountForm()
{
@lukepuplett
lukepuplett / gist:0d7e9dfb38292b168c64636f3db36fd7
Created December 4, 2018 13:50
REST API journey for updating an address on an insurance quote
```
Insurance quote people microservice.
rel method href
GET /
{ // Root links }
people:quotes GET /quotes
pt Seven Questions All Businesses Must Answer
  1. The Engineering Question: Can you create breakthrough technology (vs. incremental improvement)?

  2. The Timing Question: Is now the right time to start this particular business?

  3. The Monopoly Question: Are you starting with a big share of a small market?