Skip to content

Instantly share code, notes, and snippets.

View joejag's full-sized avatar

Joe Wright joejag

View GitHub Profile
HotKeySet("!a", "Main") ;wait for ALT-a keystroke, then go to Main()
While 1
Func Main()
AutoItSetOption( "MouseCoordMode", 0 )
WinWait( "@Alexander - Discord" )
WinActivate( "@Alexander - Discord" )

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 /
Last active March 6, 2023 23:10
Things to bring on an overnight hiking adventure


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


import datetime as DT
from itertools import cycle
import csv
rota = cycle(
"Green + Brown",
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 /
Created October 29, 2022 11:46
Create a json of the team structure of a Github org
#!/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": "", "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 /
Last active October 5, 2022 23:26
The birthday paradox. If you have 23 people, there's a 50% chance they share a birthday
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

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

Implement a function that outputs the Look and Say sequence:


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