Skip to content

Instantly share code, notes, and snippets.

View donkirkby's full-sized avatar
🐍

Don Kirkby donkirkby

🐍
View GitHub Profile
@donkirkby
donkirkby / github_admin_review.py
Created March 4, 2019 23:51
Summarize access to an organization's repositories on GitHub.
"""
Summarize access to an organization's repositories on GitHub.
Run a query like this on the GitHub explorer:
https://developer.github.com/v4/explorer/
{
organization(login: "your-org") {
name
repositories(first: 100) {
@donkirkby
donkirkby / gist:fedd09548a9e596f94a203e9ec48cf91
Created February 28, 2020 21:27
Dirty Master git tutorial
{
"goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C2\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"o/master\":{\"target\":\"C2\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null},\"my-stuff\":{\"target\":\"C3\",\"id\":\"my-stuff\",\"remoteTrackingBranchID\":\"o/my-stuff\"},\"o/my-stuff\":{\"target\":\"C3\",\"id\":\"o/my-stuff\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C3\":{\"parents\":[\"C1\"],\"id\":\"C3\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"}},\"tags\":{},\"HEAD\":{\"target\":\"my-stuff\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C2\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"my-stuff\":{\"target\":\"C3\",\"id\":\"my-stuff\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3
@donkirkby
donkirkby / format.sql
Created April 19, 2022 18:00
Format SQL*Plus output
set linesize 200
set pagesize 50000
column some_name format a30
-- More ideas at https://docs.oracle.com/cd/A57673_01/DOC/server/doc/SP33/ch4.htm
@donkirkby
donkirkby / search.py
Created February 26, 2023 19:54
Live Coding Demo
def search(a, n):
low = 0
high = len(a) - 1
while True:
mid = low + high // 2
v = a[mid]
if v == n:
@donkirkby
donkirkby / summarize_git_changes.py
Created May 1, 2024 20:45
Look for git changes not tagged with issue numbers
from collections import defaultdict
import re
from subprocess import CalledProcessError, run, PIPE, STDOUT
# Dump list of changed files
# git diff --name-only v6.6.3 master
# Log of changes to a file between two commits
# git log v6.6.3..master views/qcs_task/index.rhtml