Skip to content

Instantly share code, notes, and snippets.

You are in a maze of twisty little passages, all alike.

Chris Schmich schmich

You are in a maze of twisty little passages, all alike.
View GitHub Profile
schmich /
Created Aug 11, 2019
Multi-machine feature branch git workflow

Machine 1

Create a feature branch and sync it to origin.

git checkout -b person/feature-branch
git push -u

Machine 2

schmich / notification.js
Created Sep 20, 2018
Cookie clicker audio notification
View notification.js
(new MutationObserver(e => {
if (e && e[0] && e[0].addedNodes && e[0].addedNodes.length > 0) {
if (!window.cookieSound) {
window.cookieSound = new Audio();
window.cookieSound.src = '';
})).observe(document.getElementById('shimmers'), { childList: true });
schmich / vue.html
Last active Jun 28, 2018
Vue quick prototyping template
View vue.html
<!DOCTYPE html>
<script src=""></script>
<div id="app">
schmich /
Last active Mar 21, 2018
Flexbox vertical centering with top overflow limit


  • Vertically-centered flexbox layout
  • Absolutely-positioned fullscreen container (top/left/right/bottom: 0)
  • On content overflow, content is contained at the top and scrolls to the bottom
  • The crux of the layout:
    • .container { justify-content: space-between; } and .container .content { margin: auto 0; }
    • This allows the content to be centered in the flexbox container while not otherwise overflowing the top
  • The content is positioned just above center with .container .content { padding-bottom: 100px; }
schmich / pwned-interactive.rb
Last active Mar 12, 2019
Check if a password has been pwned with the Pwned Passwords V2 API
View pwned-interactive.rb
# Check a single password interactively.
# Usage: ruby pwned-interactive.rb
require 'io/console'
require 'open-uri'
require 'digest'
puts "The 5-character prefix of the password's SHA-1 hash will be sent."
puts "For details, see"
print 'Password (hidden): '
schmich /
Last active Sep 26, 2018
VirtualBox/CentOS setup

Setup host-only networking

This creates a dedicated network between the host and guest, allowing you to SSH and use other network services without the need of an external router.

  • In VirtualBox, edit VM settings and add a second host-only network adapter
  • Log into the guest VM
  • Run ifconfig, note the new adapter's interface name (like enp0s8)
  • Run nmtui
    • Edit a connection > Add > Ethernet
    • Profile name: Host-only Adapter
schmich /
Last active Aug 8, 2020
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.


Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

schmich /
Last active Jan 17, 2018
Shrink VM drive: VMWare Workstation & CentOS

Guest OS:

xfs_fsr # Defrag.
cat /dev/zero | pv | cat > /zerofile # Write zeroes until space runs out.
sync && shutdown now # Flush and reboot.
rm /zerofile && sync && shutdown now # Remove file, flush, and shutdown.

Host OS:

schmich / hosts
Last active Aug 12, 2017
Adblock hosts
View hosts
schmich /
Last active Jul 2, 2020
Publish a prerelease package to NPM
  • Update package.json, set version to a prerelease version, e.g. 2.0.0-rc1, 3.1.5-rc4, ...
  • Run npm pack to create package
  • Run npm publish <package>.tgz --tag next to publish the package under the next tag
  • Run npm install --save package@next to install prerelease package
You can’t perform that action at this time.