Skip to content

Instantly share code, notes, and snippets.

@runofthemill
runofthemill / README.md
Created Mar 3, 2020
Lazy loaded NVM version in iTerm2 Status Bar component
View README.md

Source custom.zsh in your zsh profile, then in iTerm 2 go to Preferences -> Profiles -> Session, and under Miscellaneous check "Status bar enabled" then click "Configure Status Bar".

Add an Interpolated String component, then configure the String Value to be \(user.nodeVersion) (adjust to match the name of the variable set in iterm2_print_user_vars(), if different)

Now when you load a new session with the configured profile, the Status Bar will show "unset" until node is loaded from nvm, and will show the correct version whenever nvm use is called.

View config.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ACPI</key>
<dict>
<key>Add</key>
<array>
<dict>
<key>Comment</key>
View keybase.md

Keybase proof

I hereby claim:

  • I am runofthemill on github.
  • I am runofthemill (https://keybase.io/runofthemill) on keybase.
  • I have a public key ASDm6AAKR6eXu1Ok4GDiQbRl_HGuTy4EcsYjFSRvXrka-Qo

To claim this, I am signing this object:

@runofthemill
runofthemill / vagrant.zsh
Created Dec 27, 2018
Vagrant plugin for spaceship-prompt
View vagrant.zsh
#
# Vagrant
#
# Vagrant is a tool for building and managing virtual machine environments in a single workflow.
# Link: https://www.vagrantup.com
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
@runofthemill
runofthemill / NoVNC_Paste.js
Created Nov 13, 2018 — forked from byjg/NoVNC_Paste.js
How to Paste code to NoVNC.
View NoVNC_Paste.js
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
window.sendString = function (str) {
f(str.split(""));
function f(t) {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = character.match(/[a-z!@#$%^&*()_+{}:\"<>?~|]/);
@runofthemill
runofthemill / roots-aliases.plugin.zsh
Last active Aug 8, 2018
Aliases for navigating a Roots project in a local environment. Inspired by https://gist.github.com/knowler/7c0686c4c1876980657f369213287749
View roots-aliases.plugin.zsh
root() {
local root
if [[ "$PWD" == *"/trellis"* ]]; then
root=${PWD%/trellis*}
elif [[ "$PWD" == *"/site"* ]]; then
root=${PWD%/site*}
elif [[ -d "$PWD/trellis" || -d "$PWD/site" ]]; then
root=${PWD}
fi
View DigitalOcean_NoVNC_Paste.js
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
View PokerChallenge.js
var _ = require('lodash');
var hand = []
var input = [process.argv[2], process.argv[3], process.argv[4], process.argv[5], process.argv[6]]
var isSuited
var isStraight
var sortedHand = []
var cardOrder = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
var analyzeHand = function() {