This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarnlinks() { | |
bold() { | |
echo -e "\033[1m$1\033[0m" | |
} | |
italic() { | |
echo -e "\033[3m$1\033[0m" | |
} | |
italic "looking for links in ~/.config/yarn/link ..." | |
LINKS=$(find ~/.config/yarn/link -type l -ls | awk '{print $11 "," $13}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rainbow = (s: string) => { | |
const colors = [ | |
'red', | |
'orange', | |
'yellow', | |
'green', | |
'blue', | |
'indigo', | |
'violet', | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: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; |