Skip to content

Instantly share code, notes, and snippets.


Chad Lavimoniere chadlavi

View GitHub Profile
chadlavi / preact-template.html
Last active Jun 2, 2021
a one-pager preact app template
View preact-template.html
<!-- cf. -->
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
/* Loading spinner styles. Delete this style tag if you remove the loading spinner. */
View fp6-dark.css
:root {
--link-color: #000099;
--grey-color: #757575;
--light-grey-color: #efefef;
--text-color: black;
--background-color: white;
--navy-color: #072284;
--orange-color: #c75300;
--yellow-color: #f2d037;
--base-font-size: 15px;
chadlavi /
Created Sep 13, 2020
bash function wrapper around a node script to check color contrast.
# calculate the WCAG contrast ratio between a single hex color and white, or
# between two hex color values
contrast () {
if [ -x "$(command -v node)" ]; then
node -e "function hexToRgb(hex) {
const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(
(_m, r, g, b) => r + r + g + g + b + b

5e wild magic goose

Player character race: Angry Goose


Your angry goose character has a number of traits.

Ability Score Increase

+2 Charisma, +1 Dexterity

chadlavi /
Last active Jul 21, 2020
Frequency illusion or creepy tech?

We've all experienced the creepy moment when something you discussed recently in private is suddenly shown to us in online advertising. Is this just the frequency illusion, or is it creepy tech spying on us?

recent incidents:

  • 20200720, I mentioned to my wife (out loud, in our home) that we need a new toilet brush. The next day, she was shown an as for toilet bridges on Instagram.
chadlavi / no-ads-hn.user.js
Last active Jun 18, 2020
automatically click "hide" on ads in hackernews
View no-ads-hn.user.js
// ==UserScript==
// @name No ads on HN
// @version 0.0.1
// @author Chad Lavimoniere
// @grant none
// @include*
// @downloadURL
// @updateURL
// ==/UserScript==
chadlavi / rainbowLog.ts
Last active Feb 29, 2020 — forked from Benargee/rainbowLog.js
A console.log with a little more... flair.
View rainbowLog.ts
const rainbow = (s: string) => {
const colors = [
chadlavi / remove-badUTM.user.js
Last active Feb 26, 2020
a greasemonkey script to remove bad UTM tags from link HREFs
View remove-badUTM.user.js
const removeBadTags = (badTags) => {
const links = [...document.querySelectorAll('a')]
(l) => {
(b) => {
const badFirstRegex = RegExp(`[\?]${b}=[^\?&#]*`, 'gi')
const badSecondRegex = RegExp(`[&]${b}=[^\?&#]*`, 'gi')
if (l.href.match(badFirstRegex)) {
chadlavi /
Last active Mar 28, 2020
a bash function to quickly identify any yarn links you've got set up currently
chadlavi / hn.user.js
Last active Apr 14, 2020
give HN a dark mode
View hn.user.js
// ==UserScript==
// @name HN accessibility patch
// @version 1.0.0
// @namespace
// @author Chad Lavimoniere
// @grant none
// @include*
// @downloadURL
// @updateURL
// ==/UserScript==