Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# check_forks_upstream.sh
# Lists forks on your GitHub account where you have never contributed:
# 1. No commits on default branch authored by you
# 2. No orphan branches (branches not present in upstream) whose first commit is yours
#
# Usage (GitHub Actions):
# curl -fsSL https://gist.github.com/RichardFevrier/dcfcc55ed38e16be4e6f1288c22399fe/raw/check_forks_upstream.sh \
# | GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} sh
#!/bin/sh
# find_local_clean_forks.sh
# Recursively finds GitHub forks where nothing needs to be committed or pushed.
#
# Usage (installed):
# find_local_clean_forks.sh <search_path>
#
# Usage (direct from gist, argument passed to sh via -s):
# curl -fsSL https://gist.github.com/RichardFevrier/447c90f54baa9f029c25040f9bf718e5/raw/find_local_clean_forks.sh | sh -s <search_path>
@RichardFevrier
RichardFevrier / macOS_cli_create_admin_user.sh
Last active March 13, 2026 18:28
macOS cli create admin user
#!/bin/sh
# Usage:
# curl -fsSL https://gist.github.com/RichardFevrier/6e515aaaadc5d3b72906be6f23689867/raw/macOS_cli_create_admin_user.sh | sudo ID=1000 NAME=richard PASSWORD=azerty sh
dscl . -create /Groups/$NAME
dscl . -create /Groups/$NAME gid $ID
dscl . -create /Users/$NAME
dscl . -create /Users/$NAME UserShell /bin/zsh
#!/usr/bin/env -S python3 -u
# -*- coding: utf-8 -*-
import subprocess
def _main() -> None:
installed_fedora_app_ids: list[str] = []
process = subprocess.Popen(['flatpak', 'list', '--columns=application,origin'], stdout=subprocess.PIPE)
@RichardFevrier
RichardFevrier / git_cleaner.rb
Last active August 26, 2019 14:52
Git cleaner
#!/usr/bin/ruby
Dir.glob("**/*/") do |filepath|
if File.exist?("#{filepath}.git/")
`cd #{Dir.pwd}/#{filepath} && git gc`
end
end
@RichardFevrier
RichardFevrier / git_lfs_cleaner.rb
Last active August 26, 2019 14:53
Git LFS cleaner
#!/usr/bin/ruby
Dir.glob("**/*/") do |filepath|
if File.exist?("#{filepath}.git/lfs/")
`cd #{Dir.pwd}/#{filepath} && git lfs prune`
end
end
@RichardFevrier
RichardFevrier / 1_ .clang-format
Last active August 14, 2019 12:04
ObjC cleaning
BasedOnStyle: LLVM
BreakBeforeBraces: Linux
ColumnLimit: 135 # fine with a macbook pro 15" screen
IndentWidth: 4
IndentWrappedFunctionNames: true
MaxEmptyLinesToKeep: 2
ObjCBinPackProtocolList: Always
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true