Skip to content

Instantly share code, notes, and snippets.

View jonchurch's full-sized avatar
♥️

Jon Church jonchurch

♥️
View GitHub Profile
@jonchurch
jonchurch / gist:c4ab048c81b0c0caba2cca4f0cefbf52
Created February 6, 2023 19:13
Get unique filenames from eslint output
# input looks like
# ~/proj/src/some/file/path.tsx(60,9): error jest/no-conditional-expect : Avoid calling `expect` conditionally`
npm run lint -- --quiet | awk 'BEGIN { FS="(" }; {print $1O}' | uniq -u
@jonchurch
jonchurch / git.md
Last active January 4, 2025 17:26
Git Tricks I Use

Viewing Commits

I want to look at commit history, individual commits, the changes a commit brought, etc.

I don't know the exact commit or range I want.

To see X number of commits, pass a numerical flag: git log -3 will output the last 3 commits.

Further filter by author:

function copyBranch() {
navigator.clipboard.writeText(
document.querySelector('.pr-header-branches').children[0].textContent
)
}
@jonchurch
jonchurch / git-blame-ignore-commits.md
Last active August 19, 2022 16:47
Ignoring Formatting Commits in Git Blame with Ignore Revs

Ignoring Formatting Commits in Git Blame

Some commits touch many files at once to do QoL or reformat code, with trivial diffs. These commits infamously muddy the output of git blame.

However, since git v2.23, git allows you to provide a list of commits to ignore in the blame. This feature is called "ignore revision(s)"

You can provide these commits in multiple ways:

  1. the CLI flag --ignore-rev <commit>
  2. the CLI flag --ignore-revs-file which accepts a file in fsck.skipList format (commits seperated by newlines, # prefixed comments allowed as of Git 2.20) NOTE: at time of writing (git v2.25.1) this flag will evaluate the path relative to your repo root, not your current working directory!
@jonchurch
jonchurch / gitPerf.md
Last active July 21, 2022 15:13
Speed up performance of large git repos

Git Perf Improvements

  • Enable git config feature.manyFiles true to opt in to a few settings to help speed up large repos. At time of writing it sets index.version=4 and core.untrackedCache=true
  • Run git gc to garbage collect unreachable objects, clean up reflog. Under the hood this runs git prune && git repack && git rerere
  • Do you have a slow startup time for new shell sessions? Many devs are using some prompt that shows git status in your prompt. After every command it will use git to check the status of your index. When git is slow in general, this will slow down your interactive shells. One quick solution is to disable that status check in your prompt. For zsh you can do that by running git config oh-my-zsh.hide-info true, add a --global flag if you want to set this option globally.
@jonchurch
jonchurch / v5_changes.md
Last active May 13, 2020 23:49
Express v5 Changes by System as of 5.0.0-alpha.8
@jonchurch
jonchurch / chars.md
Last active May 2, 2020 00:05
Dune Characters, most of em

Spice / Melange / Geriatric Spice

The stuff that must flow, idk why it has so many names.

Paul Atreides

The protagonist of Dune. Paul is the son of Duke Leto Atreides and is the heir to the House of the Atreides. At the beginning of the novel, Paul is fifteen years old. He has been trained from birth to fulfill the role of duke, and he is adept at combat and strategic thinking.

Jessica

@jonchurch
jonchurch / watch.md
Last active January 24, 2022 15:03
Watch all repos in a github org

Watch All Repos in a Github Organization

Visit your tokens page and generate a new token with the scopes repo, notifications.

Copy it to your clipboard. Keep the page open until you're done watching orgs, in case you need to copy it again.

Then open your terminal and replace TOKEN with your token and YOURORG with the organization or username that you want to watch in the following command:

WATCH_GH_REPOS=TOKEN npx watch-gh-repos -o -w YOURORG
#!/bin/bash
# Basic user preference setup
sudo yum update -y
sudo yum install -y git zsh tmux util-linux-user
cd /home/ec2-user || exit
# oh-my-zsh
@jonchurch
jonchurch / v3.2.0.txt
Created February 28, 2020 23:31
path-to-regexp pack size
npm notice
npm notice 📦 [email protected]
npm notice === Tarball Contents ===
npm notice 1.1kB LICENSE
npm notice 10.5kB index.js
npm notice 1.1kB package.json
npm notice 5.5kB History.md
npm notice 9.0kB Readme.md
npm notice 3.7kB index.d.ts
npm notice === Tarball Details ===