Download the inspect-registers.vim
file from this gist. Open the file in Vim, launching with no vimrc:
vim -Nu NONE inspect-registers.vim
Source the file:
:source %
Insert text on line one:
function _common_section | |
printf $c1 | |
printf $argv[1] | |
printf $c0 | |
printf ":" | |
printf $c2 | |
printf $argv[2] | |
printf $argv[3] | |
printf $c0 | |
printf ", " |
#!/usr/bin/env sh | |
ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{printf("%.2f%%\n", $10/$5 * 100)}' |
# Complete words from tmux pane(s) {{{1 | |
# Source: http://blog.plenz.com/2012-01/zsh-complete-words-from-tmux-pane.html | |
# Gist: https://gist.github.com/blueyed/6856354 | |
_tmux_pane_words() { | |
local expl | |
local -a w | |
if [[ -z "$TMUX_PANE" ]]; then | |
_message "not running inside tmux!" | |
return 1 | |
fi |
Download the inspect-registers.vim
file from this gist. Open the file in Vim, launching with no vimrc:
vim -Nu NONE inspect-registers.vim
Source the file:
:source %
Insert text on line one:
#!/bin/bash | |
baseurl="http://somafm.com" | |
tmpdir="/tmp/" | |
boldtext=`tput bold` | |
normaltext=`tput sgr0` | |
WGET="/usr/bin/wget" | |
MPLAYER="/usr/bin/mplayer" | |
stationnames=("Christmas Rocks!" "Christmas Lounge" "Xmas in Frisko (holiday)" "Groove Salad (ambient/electronica)" "Lush (electronica)" "Earwaves (experimental)" "Deep Space One (ambient)" "Drone Zone (ambient)" "PopTron (alternative)" "DEF CON Radio (specials)" "Dub Step Beyond (electronica)" "Space Station Soma (electronica)" "Mission Control (ambient/electronica)" "Indie Pop Rocks! (alternative)" "Folk Forward (folk/alternative)" "BAGeL Radio (alternative)" "Digitalis (electronica/alternative)" "Sonic Universe (jazz)" "Secret Agent (lounge)" "Suburbs of Goa (world)" "Boot Liquor (americana)" "Illinois Street Lounge (lounge)" "The Trip (electronica)" "cliqhop idm (electronica)" "Iceland Airwaves (alternative)" "Covers (eclectic)" "Underground 80s (alternative/electronica)" "Beat Blender (electronica)" "Doomed (ambient/industrial)" "Black Rock FM (eclectic)" "SF |
This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:
(async main(){...}())
as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problemsI'll leave the rest of this document unedited, for archaeological
// Using Array.prototype.reduce: | |
const getChunks = (array, size) => { | |
return array.reduce((acc, curr, i) => { | |
const pos = Math.floor(i/size); | |
acc[pos] = [...(acc[pos]||[]), curr]; | |
return acc | |
}, []) | |
} | |
// Using Array.from: |
how() { | |
YELLOW='\033[1;33m' | |
NC='\033[0m' | |
if [[ "$1" == "" || "$1" == "-h" || "$1" == "--help" ]]; then | |
echo "Usage: $0 <binary name>" | |
echo "" | |
echo "This will search for the binary in a few different places and try and determine how it was installed." | |
return 1 | |
fi |