Skip to content

Instantly share code, notes, and snippets.

@zspotter
zspotter / gh-mark-viewed.user.js
Last active July 27, 2026 18:56
Tampermonkey: fade + strike files you've marked Viewed in the GitHub PR sidebar, and collapse fully-viewed folders
// ==UserScript==
// @name GitHub PR: viewed files
// @namespace zspotter
// @version 1.2
// @description Fades + strikes through files you've marked "Viewed" in the PR file-tree sidebar.
// @match https://github.com/*/pull/*
// @updateURL https://gist.githubusercontent.com/zspotter/8eff45303b724d987d074b5d7aca69e1/raw/gh-mark-viewed.user.js
// @downloadURL https://gist.githubusercontent.com/zspotter/8eff45303b724d987d074b5d7aca69e1/raw/gh-mark-viewed.user.js
// @run-at document-idle
// @grant none
@zspotter
zspotter / nerdfind
Created July 11, 2025 18:51
TUI for rendering, searching, and copying nerdfont icons. (requires jq and fzf)
#!/usr/bin/env bash
set -euo pipefail
glyph_list() {
curl -s https://raw.githubusercontent.com/ryanoasis/nerd-fonts/refs/heads/master/glyphnames.json \
| jq -r '.METADATA as $m | del(.METADATA) | to_entries | sort_by(.key) | .[] | "\(.value.char)\t\(.key)"'
}
pbcopy_picker() {
@zspotter
zspotter / gist.md
Created August 27, 2020 19:28
Scraping FB Ads metrics and breakdowns

Some notes on using the FB Marketing Insights API to build a dashboard similar to Facebook Ads Manager Reporting --

The API docs appear very thorough, but are missing an exhaustive list of fields that you'd need to build a generic reporting tool. In my first attempt, I pulled all fields from these docs, but found a lot of discrepencies when compared to FB's UI.

It's more productive to scrape the visible options from FB's own UI, which can be done like this:

  • Visit Facebook Ads Manager Reporting and open the report builder
  • Select the Breakdowns tab
  • Use this nasty JS snippet in the dev console