public notebook

~^-_.,;^^`'|__

cake.html

asciidec.html, asciioct.html

ASCII_charts.pdf

vim.html

ffmpeg examples

Opera's "Default Partner Content"

8-bit terminal colours

16-colour (dwarfort) pallette

solarized reference

seconds-to-HHMMSS calculator

tmux reference

how-to-matrix-multiplication.jpg

small perl scripts

pinyin reference

kana reference

fullwidth forms

cyrillic for copypasting

arabic script reference


robot finds kitten


𐑣𐑬𐑢 𐑢𐑧𐑤 𐑛𐑳𐑟 𐑘𐑹 𐑚𐑮𐑬𐑟𐑻 𐑕𐑳𐑐𐑹𐑑 𐑞 𐑨𐑕𐑑𐑮𐑩𐑤 𐑐𐑤𐑱𐑯?


webpage responsiveness

put this into <head>:

<meta name="viewport" content="width=device-width, initial-scale=1" />


utf-8 encoding of U+26C4 “snowman without snow”: e216 9b16 8416 or 22610 15510 13210 | ⛄

█ ▄ ▀

Box drawing chars: U+2580 upper half, U+2584 lower half, U+2588 full block.

Block Elements


bash notes

# Set prompt to "time hostname:/working/directory $"
# Obviously for bash only, because who uses anything else?
PS1="\[\e[3m\e[1m\]\t \h:\w \$\[\e[0m\] "

export PS1

# Linux only. BSD has terrible to no ls colouring support.
LS_COLORS='di=0;34:*.zip=0;91:*.bz2=0;91:*.gz=0;91:*.xz=0;91:*.tar=0;31:ex=0;32:ln=0;36'
export LS_COLORS

Bash (and sh) syntax is weird, inconsistent and anachronistic. I nevertheless need it from time to time; hence, this section.

How to do a for loop, in this case to copy the contents of eighteen separate but sequentially numbered directories into one:

for (( i=1; $i < 19; i++ )) ; do {
   cp -Rv "Week1 $i/" Week1 ;
   rm -rv "Week1 $i" ;
} ; done

How to do a foreach loop:

for f in foo bar baz ; do {
   echo $f.qux ;
} ; done

And a foreach in perl:

for my $e (@a) { do_stuff $e; }
for (split(/:/, $ENV{thing})) { print $_, qq(\n); }

# Bash shell arithmetic
STARTTIME=$(date +%s)
sleep 1
ENDTIME=$(date +%s)
TOTALTIME=$(( $ENDTIME - $STARTTIME ))
echo Done in $TOTALTIME seconds.

A=0; B=1;
if ((A != 0 || B != 0)) ; then echo l; else echo O; fi


ls with a total: ls ... | awk '{ total += $5 }; END { print total }'


Length of a perl list: scalar @list

binmode(STDOUT, ':utf8');
binmode(STDIN, ':utf8');
binmode(STDERR, ':utf8');


One-line Quoted Printable decoder:

perl -mMIME::QuotedPrint -n -e 'print MIME::QuotedPrint::decode_qp($_);' < infile.qp > outfile


! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~

! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~


quick vim digraphs (with html entity codes)

use with Ctrl-K | see :help 24.9, :digraphs

U+2205  /0  ∅  &empty; &#8709;
U+2208  (-  ∈  &isin;  &#8712;
U+2209  ??  ∉  &notin; &#8713;
U+221E  00  ∞  &infin; &#8734;
U+2227  AN  ∧  &and;   &#8743;
U+2228  OR  ∨  &or;    &#8744;
U+2229  (U  ∩  &cap;   &#8745;
U+222A  )U  ∪  &cup;   &#8746;

/*  try { Thread.sleep(500); } catch (InterruptedException ex) { System.err.println(ex); }  */

echo 'for (my $n = 0; $n < 20; $n++) { my $x = (2 ** $n) + ((-1) ** $n); print "$x\n"; }' | perl -a

PS1="\[\e[3m\e[1m\]\t \h:\w \$\[\e[0m\] "
HISTFILESIZE=20000


octave/matlab symbolics

pkg load symbolic
syms x1 x2 x3
A=[-2 6 0 ; 8 5 3 ; 1 9 -1 ; 3 1 1]
x=[x1 ; x2 ; x3]
A*x
ans = (sym 4x1 matrix)
⎡   -2⋅x₁ + 6⋅x₂   ⎤
⎢                  ⎥
⎢8⋅x₁ + 5⋅x₂ + 3⋅x₃⎥
⎢                  ⎥
⎢  x₁ + 9⋅x₂ - x₃  ⎥
⎢                  ⎥
⎣  3⋅x₁ + x₂ + x₃  ⎦

⊂  U+2282    →  U+2192    ⇒  U+21d2
⊄  U+2284    ←  U+2190    ⇐  U+21d0
∈  U+2208    ↦  U+2186
∉  U+2209    ∅  U+2205
∀  U+2200    ∃  U+2203    ∄  U+2204
⋀  U+22c0    ⋁  U+22c1
′  U+2032    ″  U+2033    ‴  U+2034
⨁  U+2a01    ⨂  U+2a02

⎛ 239a ⎞  ⎡ 23a1 ⎤  ⎧ 23a7 ⎫
⎜      ⎟  ⎢      ⎥  ⎨      ⎬
⎝ 23a0 ⎠  ⎣ 23a6 ⎦  ⎪      ⎮
                    ⎩ 23ae ⎭
〈 U+2329  〉 U+232A 

Wikipedia: Mathematical operators and symbols in Unicode


wiki/List_of_XML_and_HTML_character_entity_references

þ Þ ð Ð Č č Š š Ž ž ʃ Ʃ ʒ Ʒ ç


LaTeX math-mode spacing characters in increasing whitespaceyness order: \! (negative) \, \: \; \ \quad \qquad

{\centering
\includegraphics[width=\textwidth, height=20mm]{filename}
}


my xkcd garden (2016-04-07)

my other garden (2016-04-08)


Hosting most graciously provided by SDF.