Skip to content

Instantly share code, notes, and snippets.

Avatar

Joe Wright joejag

View GitHub Profile
View photos.md

https://www.youtube.com/watch?v=LxO-6rlihSg

Composition rules

  1. Horiztonal Horizons
  • hold the camera with the horizon (no jaunty angles)
  • saves crop and loss
  1. Rule of thirds -
  • Use grid
  • if person walking, put bigger space to the side they are walking. Move/See into.
@joejag
joejag / hiking_kit.md
Last active March 6, 2023 23:10
Things to bring on an overnight hiking adventure
View hiking_kit.md

Pack

  • Coat, black fleece
  • extra hat + gloves
  • Boots
  • Sunglasses
  • Toothbrush etc

Done

View bins.py
import datetime as DT
from itertools import cycle
import csv
rota = cycle(
[
"Brown",
"Blue",
"Green + Brown",
"Blue",
View madison_bins_2023.csv
Subject Start date
Brown bin day 2023-01-06
Blue bin day 2023-01-13
Green + Brown bin day 2023-01-20
Blue bin day 2023-01-27
Brown bin day 2023-02-03
Green + Blue bin day 2023-02-10
Brown bin day 2023-02-17
Blue bin day 2023-02-24
Green + Brown bin day 2023-03-03
@joejag
joejag / github_teams.py
Created October 29, 2022 11:46
Create a json of the team structure of a Github org
View github_teams.py
#!/usr/bin/env python3
# Create a JSON of every team and the members for that team
# Final file has the form {"Team 1": [{"name": "Bob Smith", "email": "bob@example.com", "login": "bobsmith"}]}
from collections import defaultdict
import os
import json
from github import Github # pip install pygithub
github_api = Github(os.environ.get("GITHUB_ACCESS_KEY"))
@joejag
joejag / birthday_paradox.py
Last active October 5, 2022 23:26
The birthday paradox. If you have 23 people, there's a 50% chance they share a birthday
View birthday_paradox.py
from collections import Counter
from random import randrange
results = []
# Run this 10k times
for _ in range(0, 10000):
# Give me 23 random birth dates given 365 days in a year
birthdays = [randrange(365) for _ in range(23)]
# Check for any overlap
View README.md

Edit Distance

Write a function that returns whether two words are exactly "one edit" away using the following signature: bool OneEditApart(string s1, string s2); An edit is:

  • Inserting one character anywhere in the word (including at the beginning and end)
  • Removing one character
  • Replacing one character
View README.md

Implement a function that outputs the Look and Say sequence:

1
11
21
1211
111221
312211
13112221
View README.md

2D Spiral Array

Find the pattern and complete the function: int[][] spiral(int n) where n is the size of the 2D array.

Sample Result

@joejag
joejag / panel.md
Last active September 26, 2021 19:26
CodeCraft Testing panel
View panel.md

About the event: We need to talk about testing

We are looking to discuss some of the more exciting topics in testing right now. At the moment, we've found these to be:

  • What "should be" the human part of software testing, and what should be automated?
  • In 2021, is the testing pyramid considered harmful?
  • Observability communities suggest that we invest too much in testing pre-production. Can we move more testing to production?

But we are open to discussing other topics that you think would make for a good conversation.