Skip to content

Instantly share code, notes, and snippets.

View chadlavi's full-sized avatar
👨‍💻
Working

Chad Lavimoniere chadlavi

👨‍💻
Working
View GitHub Profile
@chadlavi
chadlavi / no-ads-hn.user.js
Last active June 18, 2020 20:33
automatically click "hide" on ads in hackernews
// ==UserScript==
// @name No ads on HN
// @version 0.0.1
// @author Chad Lavimoniere
// @grant none
// @include https://news.ycombinator.com/*
// @downloadURL https://gist.github.com/chadlavi/888a0889dadf82a60ba0f32017a5e9cb/raw/no-ads-hn.user.js
// @updateURL https://gist.github.com/chadlavi/888a0889dadf82a60ba0f32017a5e9cb/raw/no-ads-hn.user.js
// ==/UserScript==
@chadlavi
chadlavi / fp6.user.js
Last active June 6, 2020 02:36
fp6 accessibility
// ==UserScript==
// @name 6dot accessibility patch
// @version 4.0.6
// @namespace https://gist.github.com/chadlavi/1c57c8568a0ff295668b80a366f10a0d
// @author Chad Lavimoniere
// @grant none
// @include http*://6.*.org/*
// @downloadURL https://gist.github.com/chadlavi/1c57c8568a0ff295668b80a366f10a0d/raw/fp6.user.js
// @updateURL https://gist.github.com/chadlavi/1c57c8568a0ff295668b80a366f10a0d/raw/fp6.user.js
// ==/UserScript==
@chadlavi
chadlavi / hn.user.js
Last active April 14, 2020 01:13
give HN a dark mode
// ==UserScript==
// @name HN accessibility patch
// @version 1.0.0
// @namespace https://gist.github.com/chadlavi/38caf8b4ed7dcae3c4b5d5caff2ff3e7
// @author Chad Lavimoniere
// @grant none
// @include https://news.ycombinator.com/*
// @downloadURL https://gist.github.com/chadlavi/38caf8b4ed7dcae3c4b5d5caff2ff3e7/raw/hn.user.js
// @updateURL https://gist.github.com/chadlavi/38caf8b4ed7dcae3c4b5d5caff2ff3e7/raw/hn.user.js
// ==/UserScript==
@chadlavi
chadlavi / yarnlinks.sh
Last active March 28, 2020 18:23
a bash function to quickly identify any yarn links you've got set up currently
@chadlavi
chadlavi / rainbowLog.ts
Last active February 29, 2020 19:26 — forked from Benargee/rainbowLog.js
A console.log with a little more... flair.
const rainbow = (s: string) => {
const colors = [
'red',
'orange',
'yellow',
'green',
'blue',
'indigo',
'violet',
]
@chadlavi
chadlavi / remove-badUTM.user.js
Last active February 26, 2020 00:33
a greasemonkey script to remove bad UTM tags from link HREFs
const removeBadTags = (badTags) => {
const links = [...document.querySelectorAll('a')]
links.forEach(
(l) => {
badTags.forEach(
(b) => {
const badFirstRegex = RegExp(`[\?]${b}=[^\?&#]*`, 'gi')
const badSecondRegex = RegExp(`[&]${b}=[^\?&#]*`, 'gi')
if (l.href.match(badFirstRegex)) {
@chadlavi
chadlavi / links-new-tab.user.js
Last active July 19, 2019 13:52
open external links in new tab
@chadlavi
chadlavi / combine-imports.sh
Last active May 4, 2019 15:56
a (macOS-targed) bash script to combine multiple named imports from a single library into one statement
#!/bin/bash
# In this script, the library I maintain for work, "@casecommons/cbp-undercase"
# is used. I'll abstract it out in a future version of this so that the syntax
# is more like "combine-imports.sh [file] [library name]
imports=$(cat $1 | grep '@casecommons/cbp-undercase' | wc -l)
if [[ $imports -le 1 ]]; then
# next line commented out for scripted use
# echo "$1: no imports to combine."

Things I wish Google Assistant could do

This is a running list of the use cases that come up in my everyday life that I wish Google Assistant (either on my phone or on a Google Home device) could handle.

repeated/scheduled routines

"Hey Google, run routine Cleaning Time every Sunday at 11am"

location-triggered routines

"Hey Google, run routine [something] every time I get home"

data-dependent conditional logic