:hardstatus alwayslastline "%-Lw%{+d} %n%f %t %{-d}%+Lw"
- current window is "dimmed" with
%{+d}
and%{-d}
pair %-Lw
and%+Lw
shows before and after current window
see
:: | |
:: Rename Gerbers from "random-crap.ext" to "project-name.ext" | |
:: This also means you shouldn't have two files with the same extension. | |
:: | |
:: 2019.09.24 darell tan | |
:: | |
@echo off | |
setlocal EnableDelayedExpansion |
# | |
# reconstructs binary files from hex dumps | |
# designed to be more forgiving than `xxd -r` | |
# dump formats are flexible, whether grouped by 4 digits, | |
# with or without ASCII, etc. | |
# | |
# 2019.10.24 darell tan | |
# | |
import sys |
#!/usr/bin/python2 | |
# | |
# script to generate a minicom script that dumps entire flash | |
# problem is the stub seems to read all data into RAM first, | |
# so you can only do in batches | |
# | |
# 2019.10.24 | |
# inc needs to be low enough to complete within `expect` timeout | |
inc = 0x20000 |
bits = [1,0,1,0,0,0,0,1] | |
v = reduce(lambda x, y: x | y, | |
[n << p for p, n in enumerate(reversed(bits))]) | |
print '%02x' % v |
This is a very minimal example for writing your own quick-and-dirty decoder that you can use in PulseView.
This decoder displays annotations for a signal that's made up of 1 ms units. It annotates from one signal edge to another, without regard for time. If you want to handle the actual units of time, more logic is required and that's left as an exercise for the reader.
# | |
# awk one-liner to replace patterns like "<? cmd ?>" by executing cmd | |
# handy for use in config files "templates" | |
# | |
cat <<EOF | awk '{ if (match($0, /<\?(.*)?>/)) { cmd = substr($0, RSTART+2, RLENGTH-2-2); system(cmd) } else print }' | |
my directory has these files: | |
<? ls / ?> | |
EOF |
// strip query string (or search params) from "/xyz/..". URLs | |
for (let a of document.querySelectorAll('a[href^="/xyz/"]')) { | |
let u = new URL(a.href.toString()); | |
u.search = ''; | |
a.href = u; | |
} |
#!/bin/sh | |
# script to make mp4 videos start fast | |
# (i.e. shifting their moov atoms to the front) | |
FNAME=$1 | |
[ -f "$FNAME" ] || exit 1 | |
TMPFNAME=`mktemp -u ${FNAME}.XXXXXX` | |
head -c128 "$FNAME" | grep -F moov -q |