Skip to content

Instantly share code, notes, and snippets.


Andrew C. Dvorak acdvorak

View GitHub Profile
acdvorak / unicode.f90
Last active July 2, 2021 09:10
Fortran 95 Unicode string test
View unicode.f90
! unicode.f90
! From
! Modern Fortran language standards have no intrinsic support for Unicode I/O.
! To bypass this limitation, the Universal Coded Character Set defined in ISO 10646
! can be used instead, which is mostly identical to UTF-32.
! All code points of the Basic Multilingual Plane can be accessed,
! while the Supplementary Multilingual Plane is not supported.
acdvorak /
Created March 15, 2019 16:55
Git aliases: tickle (create dummy commit) and undo (revert last commit)
git config --global alias.undo '!git rev-parse HEAD | xargs git revert --no-edit'
git config --global alias.tickle '!echo foo >> temp.txt && git add temp.txt && git commit --no-verify -m "WIP: Dummy commit" && git undo'
acdvorak / htoprc
Created January 24, 2019 21:04
htop config: collapse multiple CPU cores into one graph, display per-process memory usage, highlight binary names
View htoprc
# ~/.config/htop/htoprc
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 46 47 38 49 2 1
acdvorak /
Last active January 8, 2019 21:49
GPG signing for Git commits and tags
# Set this value to `1` to test the script in a temporary directory
# without making any permanent global changes.
if [[ "$DRY_RUN" == 1 ]]; then
export GNUPGHOME="$(mktemp -d)"
acdvorak /
Created November 13, 2018 17:08
Convert video files to animated GIF with FFmpeg
# Usage: mov-to-gif path/to/ [path/to/output.gif]
# This script generates high-quality GIFs at reasonable file sizes from practically *any* type of video file.
# By default, it reduces the framerate to 10 fps and scales the resolution to 800px wide (maintaining aspect ratio), but
# those parameters can be changed below.
# If no output path is specified (second argument), the script will use the input file's path with the extension changed
# to ".gif".
acdvorak /
Created October 25, 2018 20:08
NPM module disk space calculator
cd "$TMPDIR"
mkdir npm-dep-size
cd npm-dep-size
npm install @material/top-app-bar
du -h -d 0 node_modules
# OUTPUT: 736K node_modules
acdvorak / screenshot-datastore-stats.js
Last active October 4, 2018 21:14
MDC Web Screenshot Datastore stat counter
View screenshot-datastore-stats.js
const CloudDatastore = require('../infra/lib/cloud-datastore');
const cloudDatastore = new CloudDatastore();
async function runAsync() {
const ds = cloudDatastore.datastore_;
const query = ds.createQuery('ScreenshotStatus');
// runQuery returns an array: [resultArray, cursorInfoObject]
const queryResult = await ds.runQuery(query);
acdvorak / update-golden-html-urls.js
Created August 28, 2018 22:11
Update all HTML file URLs in golden.json to the latest test pages
View update-golden-html-urls.js
* @fileoverview
const stableStringify = require('json-stable-stringify');
const LocalStorage = require('../infra/lib/local-storage');
const localStorage = new LocalStorage();
async function runAsync() {
acdvorak / gist:947148ef405818c0a17e0185f193815c
Last active August 8, 2018 00:34 — forked from dalethedeveloper/gist:1846552
Techniques for Anti-Aliasing @font-face on Windows
View gist:947148ef405818c0a17e0185f193815c

Techniques for Anti-Aliasing @font-face on Windows

It all started with an email from a client: Do these fonts look funky to you? The title is prickly.

The font in question was Port Lligat Sans from Google Web Fonts.

The "prickly" is aliasing caused by lack of hinting

acdvorak / pr-3060-stdout.log
Created July 12, 2018 18:47
PR #3060 stdout log
View pr-3060-stdout.log
$ npm run screenshot:test
> @ screenshot:test /Users/advorak/dev/mdc-web
> node "$PWD/test/screenshot/run.js" test
Build is already running (pid 23718)
Fetching remote git commits...
Prefetching golden images...
Skipping 0 screenshots: