Skip to content

Instantly share code, notes, and snippets.

Avatar
🍕

Chad Lavimoniere chadlavi

🍕
View GitHub Profile
@chadlavi
chadlavi / upload-sketch-to-git.sh
Last active Sep 10, 2021
shell script to work as middleware between Sketch and and git repo. syntax: 'upload.sh [filename] "optional commit message"'
View upload-sketch-to-git.sh
#!/bin/sh
# some parts of this forked from https://github.com/blended/sketch-collaboration
# cf. https://github.com/chadlavi/sketch-collaboration
if [ ! `command -v jq` ]; then
echo "you need to install jq. If you use Homebrew, try 'brew install jq'"
exit 1
fi
if [ -z "$1 ]; then
@chadlavi
chadlavi / preact-template.html
Last active Jun 2, 2021
a one-pager preact app template
View preact-template.html
<!-- cf. https://gist.github.com/chadlavi/da917425f0fe382a8a049d3908638995 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Preact</title>
<style>
/* 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;
View 5e-wild-magic-goose-character.md

5e wild magic goose

Player character race: Angry Goose

Traits

Your angry goose character has a number of traits.

Ability Score Increase

+2 Charisma, +1 Dexterity

@chadlavi
chadlavi / youtube-embedder.user.js
Last active Oct 16, 2020
a js script to embed youtube videos when a youtube url is present
View youtube-embedder.user.js
// ==UserScript==
// @name youtube embedder
// @version 2.0.3
// @namespace https://gist.github.com/chadlavi/27c08ea6648d375c3f5de3ec7f43a015
// @downloadURL https://gist.github.com/chadlavi/27c08ea6648d375c3f5de3ec7f43a015/raw/youtube-embedder.user.js
// @updateURL https://gist.github.com/chadlavi/27c08ea6648d375c3f5de3ec7f43a015/raw/youtube-embedder.user.js
// @description embed youtube videos when a url is present
// @author Chad Lavimoniere
// @exclude http*://*youtube.com*
// @exclude http*://*facebook.com*
@chadlavi
chadlavi / contrast.sh
Created Sep 13, 2020
bash function wrapper around a node script to check color contrast.
View contrast.sh
# 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(
shorthandRegex,
(_m, r, g, b) => r + r + g + g + b + b
);
@chadlavi
chadlavi / frequency-illusion-or-creepy-tech.md
Last active Jul 21, 2020
Frequency illusion or creepy tech?
View frequency-illusion-or-creepy-tech.md

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
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 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 Jun 6, 2020
fp6 accessibility
View fp6.user.js
// ==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 Apr 14, 2020
give HN a dark mode
View hn.user.js
// ==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==