Skip to content

Instantly share code, notes, and snippets.

View april's full-sized avatar
🔒
making the web safer

April King april

🔒
making the web safer
View GitHub Profile
@april
april / gmail packages.md
Created December 27, 2023 15:42
gmail has words search for packages

has the words:

{ "tracking number" "tracking numbers" "tracking no" "track my" "track package" "track shipment" "track your order" "track your package" "track your shipment" "track the status" "tracking link" "tracking id" "tracking information" "shipping information" "shipment tracking" "shipment status" "shipping confirmation" "shipment from" "shipped by" "priority tracking" subject:"order AROUND 2 shipped" } -{ subject:"[confidential]" subject:(bank account) subject:banking }
@april
april / find-all-electron-versions.sh
Last active October 23, 2024 17:48
find all apps using Electron and their versions, on macOS systems
# latest supported electron version as of october 2024
LATEST_SUPPORTED_VERSION=30
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # no color
mdfind "kind:app" 2>/dev/null | sort -u | while read app;
do
filename="$app/Contents/Frameworks/Electron Framework.framework/Electron Framework"
if [[ -f $filename ]]; then
@april
april / exif.txt
Created May 12, 2023 14:33
bluesky exif removal
Before:
$ exiftool DSCN0042.jpg | sort
AF Area Mode : Single Area
AF Point : Center
AF Points In Focus : (none)
Active D-Lighting : Off
Aperture : 4.4
Auxiliary Lens : Off
Bits Per Sample : 8
@april
april / invite-tree.sh
Created May 9, 2023 01:55
get your invite tree on bluesky
curl -s -H "Authorization: Bearer $(curl -s --json '{"identifier": "yourusername", "password": "yourpassword"}' https://bsky.social/xrpc/com.atproto.server.createSession | jq -j ".accessJwt")" "https://bsky.social/xrpc/com.atproto.server.getAccountInviteCodes" | jq -r '.codes[].uses[].usedBy' | xargs -I{} -P10 curl -s 'https://plc.directory/{}' | jq -r '.alsoKnownAs[0]'
@april
april / @april@macaw.social.py
Last active December 18, 2022 21:03
python infinite loop printing @april@macaw.social
# demonstrating an infinite loop in python
while True:
print("check out my profile on Mastodon - @april@macaw.social")
@april
april / git-log-json.sh
Last active September 10, 2024 07:12
pure shell function for git log as JSON
# attempting to be the most robust solution for outputting git log as JSON,
# using only `git` and the standard shell functions, without requiring
# additional software.
# - uses traditional JSON camelCase
# - includes every major field that git log can output, including the body
# - proper sections for author, committer, and signature
# - multiple date formats (one for reading, ISO for parsing)
# - should properly handle (most? all?) body values, even those that contain
# quotation marks and escaped characters
@april
april / yubikey-dvorak.sh
Last active July 23, 2022 04:54
How to get Yubikey OTP codes to work on macOS with Dvorak (etc.), without using Karabiner Elements
# note that this only works with some Yubikeys -- I have confirmed that it works
# fine with my Nano, and it should also work with the NEO, and as is documented
# here by Yubico: https://www.yubico.com/blog/yubikey-keyboard-layouts/
# first, install the ykpersonalize tool:
$ brew install yubikey-personalization
# next, we run the yubikey tool to update its internal keyboard scan map to Dvorak:
$ ykpersonalize -S0c110b071c180d0a0619130f120e09378c918b879c988d8a8699938f928e89b7271e1f202122232425269e2b28
mansplain() {
user=`echo $USER | tr "[:lower:]" "[:upper:]"`
# ugh, macos vs linux
if command -v gzcat
then
_cat() { gzcat $@; }
else
_cat() { zcat $@; }
fi
function man-preview() {
# Don't let Preview.app steal focus if the man page doesn't exist
man -w "$@" &>/dev/null && man -t "$@" | open -f -a Preview || man "$@"
}
@april
april / minimalist-vivaldi-tweaks.css
Last active October 12, 2021 15:55
tweaks for a minimalist side tabs, dark mode, Vivaldi
/* these settings were specifically done with the "dark" theme and the tabs on the right
feel free to tweak to your preferences */
/* remove title bar with side tabs */
#browser #header,
/* keep search in url bar enabled, but without search suggestions */
/* unfortunately, it is still there as far as tabbing is concerned */
/* making hiding it not really worth it at this point */
/* #browser .UrlBar .OmniDropdown-Collection:first-of-type, */