Skip to content

Instantly share code, notes, and snippets.

View GrantCuster's full-sized avatar

grant GrantCuster

View GitHub Profile
@GrantCuster
GrantCuster / toc-active.js
Created October 25, 2019 13:47
Add an active class to the table of contents link when the heading is visible. For me, this was on top of html generated through markdown-it and markdown-it-table-of-contents, but similar things could work in lots of other situations.
window.addEventListener(
"load",
() => {
let headings = document.querySelectorAll("h2, h3, h4");
let links = document.querySelectorAll(".table-of-contents ul li a");
observer = new IntersectionObserver(
(entry, observer) => {
if (entry[0].intersectionRatio === 1) {
for (let link of links) {
@GrantCuster
GrantCuster / userChrome.css
Created May 4, 2020 16:03
Minimal gruvbox skin for firefox.
#navigator-toolbox { font-family: 'JetBrains Mono' !important; border-bottom: none !important; } #navigator-toolbox #back-button { display: none; } #navigator-toolbox #forward-button { display: none; } #navigator-toolbox toolbarspring { display: none; } #navigator-toolbox .tab-line { display: none; } #navigator-toolbox #urlbar-container {
padding: 0 !important;
margin: 0 !important;
}
#navigator-toolbox #urlbar {
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
}
#navigator-toolbox #PanelUI-button {
@GrantCuster
GrantCuster / userChrome.css
Last active April 3, 2022 08:42
My minimal, gruvbox inspired Firefox customization
/* Check out https://www.reddit.com/r/FirefoxCSS/ for an explanation on how to customize */
/* This hides a ton of buttons because I use Vimium for most navigation */
/* Screenshot at https://feed.grantcuster.com/post/1596224341/ */
:root {
--base00: #282828;
--base01: #3c3836;
--base02: #504945;
--base04: #bdae93;
--base05: #d5c4a1;
@GrantCuster
GrantCuster / .gitignore
Last active April 3, 2025 18:38
test deploy
.DS_Store
node_modules/
package-lock.json
*.js