Skip to content

Instantly share code, notes, and snippets.

@justindool
justindool / WebComponent.js
Created December 16, 2021 23:44 — forked from jsmithdev/WebComponent.js
Web Component boilerplate for a native web-component (v1 spec)
/*
* Use tag to import via es6 module (html import deprecated in v1 spec :/ )
* <script type="module" src="../components/web-component/web-component.js"></script>
*/
'use strict()'
const template = document.createElement('template')
template.innerHTML = /*html*/`
<style>
.card {
@justindool
justindool / pi_setup.sh
Created May 18, 2021 19:47 — forked from AnthonyDiGirolamo/pi_setup.sh
Raspberry Pi Provisioning Script
#!/usr/bin/env bash
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp -r archives [email protected]:~/ ; ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh [email protected] 'sudo mv ~/archives/* /var/cache/apt/archives/'
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_setup [email protected]:~/ ; ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh [email protected] 'bash ~/pi_setup pi9 109'
# for pi in 110 111 112
# do
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_keys [email protected].$pi:~/.ssh/authorized_keys
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_hosts pi_mpihostsfile [email protected].$pi:~/
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp ~/.ssh/config [email protected].$pi:~/.ssh/
# ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh [email protected].$pi 'cat /etc/hosts pi_hosts | tee hosts ; sudo cp hosts /etc/hosts'
@justindool
justindool / jwtRS256.sh
Created May 27, 2019 02:44 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@justindool
justindool / service-worker-notification.js
Created February 15, 2019 08:41 — forked from deanhume/service-worker-notification.js
Service Worker Notification Click
self.addEventListener('notificationclick', function(event) {
console.log('On notification click: ', event.notification.tag);
// Android doesn't close the notification when you click on it
// See: http://crbug.com/463146
event.notification.close();
// This looks to see if the current is already open and
// focuses if it is
event.waitUntil(
clients.matchAll({
@justindool
justindool / osx_bootstrap.sh
Created November 23, 2018 06:49 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@justindool
justindool / gist:56523e67b7d4340287619825a8b03000
Created February 10, 2018 22:28 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream