Skip to content

Instantly share code, notes, and snippets.

View treyharris's full-sized avatar

Trey Harris treyharris

View GitHub Profile
#!/usr/bin/env perl6
package My-Fourth-Modules-Script {
proto MAIN($) is export { * }
multi MAIN($x) {
say "This is the inside MAIN called with $x";
}
}
#!/usr/bin/env perl6
proto MAIN($) is export { * }
package My-Fourth-Modules-Script {
multi MAIN($x) {
say "This is the inside MAIN called with $x";
}
}
@treyharris
treyharris / p6doc-output.console
Created June 20, 2019 18:07
p6doc Str weirdness
% export POD_TO_TEXT_ANSI=1
% p6doc Str
In Str
% PAGER=cat p6doc Str
In Str
===FATAL: Table 4 has a mixture of visible and invisible column-separator types.
===SORRY!===
1
space prefix non-negative number with a space
+ prefix non-negative number with a plus sign
~/src/perl6/sandbox/yes | head
y
y
y
y
y
y
y
y

Illustration

HMSSeconds %.2f
0@ 00’ 01”1.00
0@ 0’ 2.3”2.00
0@ 0’ 2.5”2.00
0@ 1’ 59.5”119.00

Some more HMS calculations

# -*- mode: snippet -*-
# name: footnote
# key: footnote
# binding: C-c ^
# --
<sup>[${1:1}](#footnote$1)</sup>
buffer-limit 50
command-alias[0] "split-pane=split-window"
command-alias[1] "splitp=split-window"
command-alias[2] "server-info=show-messages -JT"
command-alias[3] "info=show-messages -JT"
command-alias[4] "choose-window=choose-tree -w"
command-alias[5] "choose-session=choose-tree -s"
default-terminal "screen-256color"
escape-time 0
exit-unattached off
#!/bin/zsh
# -*-shell-script-*-
# If emacsclient is given no arguments, create a new emacsclient
# in-place. TODO: check arguments for --create and add --tty if
# necessary, but allow for --notty too.
local EMACSCLIENT_EXE="/usr/bin/emacsclient"
if [[ ! -x $EMACSCLIENT_EXE ]]; then
echo "zsh($0): command not found: $EMACSCLIENT_EXE" 1>&2
#!/bin/zsh
# Count the filename extensions in the current or named subtree
# Can be used as an autoloaded function or as a script.
local rootdir usage
rootdir="${PWD}"
usage="usage: $0 [DIR]"
if (( $#argv == 1 )) ; then
rootdir="${argv[1]}"
#!/bin/zsh
# Count the filename extensions in the current subtree
local rootdir
rootdir="${PWD}"
if (( $#argv == 1 )) ; then
rootdir="${argv[1]}"
fi
pushd "${rootdir}" >& /dev/null