Skip to content

Instantly share code, notes, and snippets.

View jboursiquot's full-sized avatar

Johnny Boursiquot jboursiquot

View GitHub Profile
@jboursiquot
jboursiquot / BaltimoreGo-090319-Challenge.md
Last active September 3, 2019 23:51
Baltimore Go Challenge for September 3rd, 2019 Meeting: Consume Maryland's Road Closures

Challenge: Consume Maryland's Road Closures

The state of MD exposes road closure data for you to do with whatever you'd like. Today, you'd like to fetch it and save it locally in a relational database (maybe sqlite?).

Head over to the site to explore the data.

Your mission (and success criteria):

  1. Consume the JSON endpoint for that data: https://opendata.maryland.gov/resource/nigh-m2sg.json
  2. Successfully parse each "closure" including its lat/long data, timestamps, etc.
@jboursiquot
jboursiquot / boursiquotj-cca630-p3-vpc.yaml
Created August 29, 2019 02:50
CCA 630 Project 3 VPC CloudFormation template
AWSTemplateFormatVersion: '2010-09-09'
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: "VPC Configuration"
Parameters:
- vpccidr
- publicacidr
@jboursiquot
jboursiquot / steps.md
Last active April 3, 2019 00:20
Setting yourself up to contribute to Open Source Go projects with Modules

Step 1: go get the project

$ go get github.com/GITHUB_USERNAME/GITHUB_PROJECT

Step 2: Fork the repo

  • Navigate to the project's GitHub page and fork it into your own account.
  • Clone the project locally.

Keybase proof

I hereby claim:

  • I am jboursiquot on github.
  • I am jboursiquot (https://keybase.io/jboursiquot) on keybase.
  • I have a public key whose fingerprint is 2F5A D69A 2F81 7E34 3A9C 424D CD6F A8BE 87F7 0649

To claim this, I am signing this object:

@jboursiquot
jboursiquot / keybase.md
Last active March 29, 2019 20:04
keybase.md

Please publicly post the following Gist, and name it keybase.md

Keybase proof

I hereby claim:

  • I am jboursiquot on github.
  • I am jboursiquot (https://keybase.io/jboursiquot) on keybase.
  • I have a public key ASDmOWpT1ggiUmnZeb52pnxbP3DEZh5pfFwDzBYpchU4Wgo

Red vs Blue: HTTP Showdown

Red Team: Build a temperamental HTTP server

Your mission, should you choose to accept it, is to build an HTTP server in Go that behaves erratically. Yes, your job is to write an HTTP server that misbehaves by doing the following in a non-deterministic fashion:

  • Delays responses to clients randomly between 10 and 30 seconds sometimes
  • Randomly errors out with HTTP 5XX responses
  • Rate-limits client requests adaptively in real time (for example, a client that makes 10 consecutive requests within 500 ms of each other should get throttled and receive an HTTP 429 status code)

Depth-First Search

Given the following Node struct and a slice of optional children nodes, implement a DepthFirstSearch method on Node that uses a depth-first search algorithm (navigating the tree from left to right) to return a slice of all the child node Name attributes in the appropriate order.

type Node struct {
	Name     string
	Children []*Node
}

Two-Number Sum

Write a function that takes as parameters a non-empty slice of integers and an integer representing a target sum. Your task is to return the pair of numbers within the input slice that add up to the target sum given. If no numbers in the input slice add up to the given target sum, return an empty slice. You may assume that there will be no more than one pair of numbers from the input slice that add up to the target sum.

Hint: There are several ways to do this which vary in efficiency. First focus on solving it and only then on optimizing it.

You may use the test below to exercise your solution.

Bubble Sort

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent pairs and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted. The algorithm, which is a comparison sort, is named for the way smaller or larger elements "bubble" to the top of the list. -- Wikipedia (https://en.wikipedia.org/wiki/Bubble_sort)

Create a function, bubleSort, that takes a list of integers and sorts them in non-decreasing order using a bubble sort algorithm.

For example:

Non-repeating character in a string

Write a function that takes a string and returns the first character in it that does not repeat two or more times.

Example:

nonRepeating("abcba") // should return "c"
nonRepeating("ddgTwWgpp") // should return "w"