A tab completion script that works for Bash. Relies on the BSD md5
command on Mac and md5sum
on Linux, so as long as you have one of those two commands, this should work.
$ gradle [TAB]
#!/bin/sh | |
in_place() { | |
content="$1" | |
file="$2" | |
id="$3" | |
range="/^#${id} START\$/,/^#${id} END\$/" | |
[ -f "$file" ] && [ -n "$(tail -c 1 "$file")" ] && echo >>"$file" | |
{ rm -- "$file" && sed "${range}d" >"$file"; } <"$file" && sed -n "${range}p" >>"$file" <"$content" | |
} | |
in_place "$0" "$HOME/.profile" 'Jump marks .profile' |
-accesscode - | |
-batterytestmode - rapidly cycle battery percentages for testing | |
-bigpicture - Start in Steam Big Picture mode | |
-browser-offline - | |
-cafeapplaunch - Launch apps in a cyber cafe context | |
-candidates - Show libjingle candidates for local connection as they are processed | |
-ccsyntax - Spew details about the localized strings we load | |
-cef-allow-browser-underlay - Allow webhelper to create BrowserView underlays | |
-cef-delaypageload - Enable early-out for known page loads | |
-cef-disable-breakpad - disables breakpad in crash dumps |
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
byte[].metaClass.hexdump { int idx, int len -> | |
println ''' +--------------------------------------------------+ | |
| | 0 1 2 3 4 5 6 7 8 9 a b c d e f | | |
| +----------+--------------------------------------------------+------------------+'''.stripMargin() | |
delegate[ idx..<(idx+len) ].with { bfr -> | |
def bytes = bfr.collect { String.format( '%02x', it ) } | |
.collate( 8 ) | |
.collate( 2 ) | |
.collect { a, b -> ( a + [ '' ] + b ).join( ' ' ).padRight( 48, ' ' ) } | |
def ascii = bfr.collect { it > 0x1f && it < 0x7f ? (char)it : '.' } |
#!/bin/bash | |
# A simple script to backup an organization's GitHub repositories. | |
#------------------------------------------------------------------------------- | |
# NOTES: | |
#------------------------------------------------------------------------------- | |
# * Under the heading "CONFIG" below you'll find a number of configuration | |
# parameters that must be personalized for your GitHub account and org. | |
# Replace the `<CHANGE-ME>` strings with the value described in the comments | |
# (or overwrite those values at run-time by providing environment variables). |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
#!/usr/bin/env python | |
import sys | |
import datetime | |
frankierart={ | |
0x01:'Stampit 2003', | |
0x02:'0x02???', | |
0x03:'Frankit', | |
0x05:'Filiale', | |
0x07:'Frankierservice Infopost/Infobrief', | |
0x08:'Premiumadress', |