Skip to content

Instantly share code, notes, and snippets.

View josephlou5's full-sized avatar

Joseph Lou josephlou5

View GitHub Profile
@josephlou5
josephlou5 / README.md
Last active September 5, 2026 05:51
My `jj megamerge` script

My jj megamerge script

Please read https://isaaccorbrey.com/notes/jujutsu-megamerges-for-fun-and-profit. It is quite good. Based on the ideas in that post, and because I enjoy scripting (as opposed to the aliases defined in the post being purely aliases instead of scripts) (pure aliases have benefits over scripts of course, such as native shell completion and argument passthrough), I consolidated all the "megamerge" workflow ideas into a single script that I can use, which is aliased to jj megamerge and jj mm. It also uses some other revset aliases I have

@josephlou5
josephlou5 / literal-path-fileset.md
Created August 15, 2026 06:18
Creating jj filesets for literal file paths

Creating jj filesets for literal file paths

TL;DR: Passing a literal file path as a jj fileset is hard. I wrote functions in bash and fish to make it easier. Also follow jj-vcs/jj#4509 for upstream CLI updates which should hopefully make this tip obsolete.

Background

In jj, there is a

@josephlou5
josephlou5 / sheet_column_string_label.md
Created July 22, 2026 05:52
Formula to get the column string label (e.g., "A", "B", "AC") in a Google Sheet

How to get a column string label

In Google Sheets, rows are numbered 1, 2, 3 while columns are labeled "A", "B", "C". The columns can be thought of as base 26 (almost*) but using only letters, since after "Y" and "Z", it wraps around to "AA" and continues to count with "AB", "AC", etc. Finding the column string label from a column index can be a [fun coding question][leetcode to title], or it can be annoying in Google Sheets.

Through my testing, it seems that columns have a limit of 18278, which is column

@josephlou5
josephlou5 / current_sheet_name.md
Created November 16, 2025 02:50
Formula to get the name of the current sheet in Google Sheets

How to get the current sheet's name in Google Sheets

Lots of people have suggestions at https://stackoverflow.com/q/45502538. Some of those answers inspired the methods I provide below.

Both methods require a way to parse a sheet name from a cell reference. To do this, we'll add a named function.

Go to "Data > Named functions", click "Add New Function", and input the

@josephlou5
josephlou5 / publicSheetFetch.ts
Last active November 25, 2025 05:57
Fetch data from a public Google Sheet using the Graph Visualization Query Language
/**
* @fileoverview
* Fetches data from a public Google Sheets using the Graph Visualization Query
* Language.
*
* See: https://developers.google.com/chart/interactive/docs/querylanguage
*
* Hint: Run with: `npx tsx publicSheetFetch.ts`
*
* =============================================================================
@josephlou5
josephlou5 / run_codepost_tests.py
Created March 8, 2023 05:11
Runs the codePost tests for the given assignments or submissions
"""
Runs the codePost tests for the given assignments.
The requests in this script come from looking at the network calls on
the codePost webpage. As such, they are not part of any agreed-upon API,
and are subject to change at any time. Use at your own risk.
This script uses the `asyncio` module to make requests for each
assignment in parallel. This means that to run the tests for all the
assignments will only take as long as the slowest assignment. However,
@josephlou5
josephlou5 / get_file_history.py
Last active December 1, 2022 02:23
Gets the history of a specific file in all the commits of a repository
"""
get_file_history.py
Gets the history of a specific file in all the commits of a repo.
GitPython: https://gitpython.readthedocs.io/en/stable/index.html
"""
# ==============================================================================
import json