Skip to content

Instantly share code, notes, and snippets.

@hivehand
hivehand / qrenc-wifi
Last active May 17, 2024 18:09
Scriptlet for creating QR codes that let people join a WiFi network just by scanning the code.
#! /usr/bin/env ruby
# Take a network SSID as an argument, and prompt for the corresponding
# password. Generate a WiFi-network credential set suitable for QR
# encoding as defined in:
#
# https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11
#
# then generate that QR code and save it to `<SSID>-QR.png`.
#
@hivehand
hivehand / ppmesh.ps
Last active November 17, 2022 20:15
Teeny tiny hexagon tiling
% Draw, in white on black, the set of Pointer Pattern Pad hexagons described
% here:
%
% http://bitsavers.trailing-edge.com/pdf/xerox/mouse/lyon_optical/018P87005_D_Pointer_Pattern_Pad_Oct84.pdf
/inch { 72 mul } def
% Alter the following for different page sizes.
/pagewidth 8.5 inch def
/pageheight 11 inch def

Keybase proof

I hereby claim:

  • I am hivehand on github.
  • I am hivehand (https://keybase.io/hivehand) on keybase.
  • I have a public key whose fingerprint is 81C1 26A8 A38B FBB7 200D B895 94E1 A0A3 0F83 30FB

To claim this, I am signing this object:

@hivehand
hivehand / pds.sh
Created February 12, 2015 00:38
Mac-only bash function to push a personalized datestamp into the paste buffer.
function pds {
local user_name=$(dscl . read /Users/$(whoami) RealName | grep -v RealName | \
cut -c 2- | sed -E 's/ ([^ ])[^ ]*$/ \1/')
echo "[$user_name, $(date +%F)]" | pbcopy
}