This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Print a breakdown of the passed filepaths by CODEOWNER team. | |
This script requires the `codeowners` CLI tool to be installed and available on the $PATH. | |
https://github.com/hmarr/codeowners | |
Intended usage is to pipe filepaths into this script from the root of a repo: | |
cat filepaths.txt | codeowner-breakdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import nox | |
@nox.session(python=["3.10", "3.11", "3.12"]) | |
@nox.parametrize("django_constraint", ["<4.2", "<4.3", "<5.1"]) | |
def tests(session: nox.Session, django_constraint: str) -> None: | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# This script can be used as a Alfred Script Filter in a custom workflow for converting numbers to durations. | |
# To do so, create a new workflow, add a script filter with contents './convert "$@"', ensuring that the | |
# query is passed as "with input as argv". | |
# | |
# It's useful to connect a "Copy to Clipboard" output action to make it easier to paste the duration string somewhere. | |
import argparse | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Print a title of the current pull request's commits. | |
# | |
# - For single commit pull requests, this prints the subject of the commit. | |
# | |
# - For multi-commit pull requests, this uses OpenAI's REST API to digest the | |
# commit messages of the pull request into a single sentence. | |
# | |
# Requires an OPENAI_API_KEY env var to authenticate requests - see: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Print out a summary of the pull request. | |
# | |
# This combines the commit messages and removes the hard wrapping so the text renders better in | |
# Github's UI. The output won't be suitable as is, but provides a good start for moulding into a | |
# good description. | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Print a summary of the current pull request's commits. | |
# | |
# Requires an OPENAI_API_KEY env var to authenticate requests - see: | |
# https://beta.openai.com/docs/api-reference/authentication | |
# Commit selection variables. | |
TARGET_BRANCH=master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Print the users who have access to a given 1Password item. | |
# | |
# Usage: | |
# | |
# 1pw-item-users "$ITEM_NAME" | |
# | |
# Note, the `op` tool must be authenticated before this command is run. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To use this, create a new Apps Script project and paste this script in. | |
// https://developers.google.com/apps-script | |
function FetchReport() { | |
// Define a Gmail search query. | |
var searchQuery = "cluedo after:2022-01-01" | |
// Define a predicate that determines when to stop looping. | |
function shouldWeKeepLooping(thread) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Script to wrap JSON front-matter in markdown files with `---` delimiters. | |
# | |
# This allows Prettier to be used on the markdown file (and it won't try and format the JSON front | |
# matter). | |
# | |
# I needed this to convert old Hugo markdown files that had JSON front-matter. | |
import os | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script that opens the Github pull request search page filtered to show closed pull | |
# requests from the last week, from members of a specified set of users. | |
# | |
# This can be useful for team leads when writing progress reports. | |
# Config | |
# ------ |
NewerOlder