Skip to content

Instantly share code, notes, and snippets.

@michaelhood
michaelhood / midi.html
Last active April 1, 2021 14:56
webmidi hax
<div id="devices"></div>
<br/>
<h3>Select your midi device, play some notes.</h3>
<br/>
<div id="letters"></div>
diff --git i/build.gradle w/build.gradle
index 0d6ebc9..96ce52c 100644
--- i/build.gradle
+++ w/build.gradle
@@ -4,17 +4,21 @@ buildscript {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
+ maven {
+ url "https://plugins.gradle.org/m2/"
@michaelhood
michaelhood / .cvimrc
Created July 22, 2018 08:37 — forked from troyp/.cvimrc
.cvimrc
" ________
" | |
" | CVIMRC |
" |________|
" ,----------,
" | settings |
" '----------'
set localconfig
import r2 from '@mcro/r2'
import puppeteer from 'puppeteer'
import * as _ from 'lodash'
const sleep = ms => new Promise(res => setTimeout(res, ms))
const onFocus = page => {
return page.evaluate(() => {
return new Promise(res => {
if (document.hasFocus()) {
res()
@michaelhood
michaelhood / _1_"script async defer" blocks "load" event.md
Created June 15, 2018 21:00 — forked from jakub-g/_1_"script async defer" blocks "load" event.md
Beware of "script async defer" blocking HTML "load" event

Beware of <script async defer> blocking HTML "load" event

2015.10.07 t

On the importance of simulated latency testing, and bulletproofing your page from the third-party JS load failures

TL;DR

@michaelhood
michaelhood / background.js
Created April 24, 2018 07:37 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@michaelhood
michaelhood / bash-template
Created March 23, 2018 06:32 — forked from renzok/bash-template
A template bash script based on google style guide with some little improvements
#!/bin/bash
# Here short description of this script
# This is just a template to be used for writing new bash scripts
###
# Based on Google Style Guide: https://google.github.io/styleguide/shell.xml
# General remarks
# * Executables should have no extension (strongly preferred) or a .sh extension.
# * Libraries must have a .sh extension and should not be executable
@michaelhood
michaelhood / concentrate.js
Last active July 5, 2017 07:31 — forked from kdzwinel/concentrate.js
DevTools snippet that lets you focus on a single element during developement
(function() {
function hideEverythingAround($el) {
const $parent = $el.parentElement;
$parent.style.transition = 'background-color 150ms ease-in';
$parent.style.backgroundColor = 'white';
$parent.childNodes.forEach($child => {
if($child !== $el && $child.style) {
@michaelhood
michaelhood / disable-full-sync-on-flush.sh
Created June 20, 2017 10:57 — forked from mkrakauer-rio/disable-full-sync-on-flush.sh
Docker for Mac - Disable full disk sync on flush
cd ~/Library/Containers/com.docker.docker/Data/database/
git reset --hard
cat com.docker.driver.amd64-linux/disk/full-sync-on-flush
# if you see true, continue
echo false > com.docker.driver.amd64-linux/disk/full-sync-on-flush
cat com.docker.driver.amd64-linux/disk/full-sync-on-flush
# you should now see false
git add com.docker.driver.amd64-linux/disk/full-sync-on-flush
git commit -s -m "Disable flushing"
# wait for docker to restart