Skip to content

Instantly share code, notes, and snippets.

Avatar
🍕

Chad Lavimoniere chadlavi

🍕
View GitHub Profile
@chadlavi
chadlavi / combine-imports.sh
Last active May 4, 2019
a (macOS-targed) bash script to combine multiple named imports from a single library into one statement
View combine-imports.sh
#!/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."
View google-assistant-wishlist.md

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

@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==
View Preferences.sublime-settings
{
"color_scheme": "Packages/Monokai Dark/Monokai Dark.tmTheme",
"drag_text": false,
"font_size": 12,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"rulers":
@chadlavi
chadlavi / spotify-embed.user.js
Last active Nov 1, 2018
a js script to embed spotify playlists or albums when a spotify share url is present
View spotify-embed.user.js
// ==UserScript==
// @name spotify embedder
// @version 1
// @namespace https://gist.github.com/chadlavi/eba2e3420fb9c1a6a891f8ed2c29e2ae
// @downloadURL https://gist.github.com/chadlavi/eba2e3420fb9c1a6a891f8ed2c29e2ae/raw/spotify-embed.user.js
// @updateURL https://gist.github.com/chadlavi/eba2e3420fb9c1a6a891f8ed2c29e2ae/raw/spotify-embed.user.js
// @description embed spotify player when a url is present
// @author Chad Lavimoniere
// @exclude http*://*youtube.com*
// @exclude http*://*facebook.com*
@chadlavi
chadlavi / get_images.sh
Created Oct 16, 2018
a simple script to get an arbitrary number of sample images from unsplash, organized by aspect ratio
View get_images.sh
#!/bin/sh
mkdir -p example_images/landscape
mkdir -p example_images/portrait
loop=0
iterations=50
while [ $loop -lt $iterations ]; do
x=$(( $RANDOM % 950 + 50 ))
@chadlavi
chadlavi / notes.sh
Created Jul 16, 2018
add me to your bash_functions
View notes.sh
note () {
local note="$HOME/notes.md"
if [ ! -z "$1" ]
then
gdate +###\ %Y-%m-%d\ %H:%M >> $note
echo "$@" >> $note
echo "" >> $note
else
vim + -c ':r! gdate +\#\#\#\ \%Y-\%m-\%d\ \%H:\%M && echo' +star $note
fi
@chadlavi
chadlavi / ubuntu_16.04_certbot.sh
Created Apr 26, 2018
Install certbot on Ubuntu 16.04
View ubuntu_16.04_certbot.sh
#!/bin/bash
# Install certbot on Ubuntu 16.04
# if parameter "run" is passed to the script like `ubuntu_16.04_certbot.sh run`, it also runs "sudo certbot certonly" after install
# cf. https://certbot.eff.org/lets-encrypt/ubuntuxenial-other
sudo apt-get update -y &&\
sudo apt-get install software-properties-common &&\
sudo add-apt-repository ppa:certbot/certbot &&\
sudo apt-get update -y &&\
View night-mode.user.js
// ==UserScript==
// @name Night Mode
// @namespace https://gist.github.com/chadlavi/d57509a35bc03305b28b3938dab0594f
// @downloadURL https://gist.github.com/chadlavi/d57509a35bc03305b28b3938dab0594f/raw/night-mode.user.js
// @updateURL https://gist.github.com/chadlavi/d57509a35bc03305b28b3938dab0594f/raw/night-mode.user.js
// @version 2.53
// @description turn on night mode between the night and morning times
// @author Chad Lavimoniere
// @include http*://6.f*.org/*
// @grant none