Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block phiresky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
phiresky / motioninterpolation.vpy
Last active May 29, 2020
Realtime motion interpolating 60fps playback in mpv
View motioninterpolation.vpy
# vim: set ft=python:
# see the README at
# source:
# source:
# source:
import vapoursynth
core = vapoursynth.get_core()
phiresky /
Created May 29, 2020
ripgrep pdf text extractor with caching that is much faster than pdfgrep
# usage: `rg --no-line-number --sort-files --pre pdfextract "$@"`
# better and much faster solution:
mkdir -p "$cachedir"
View newscatcher-json.html
<meta charset="utf-8">
<script src=""></script>
async function go() {
const SQL = await initSqlJs();
const dbres = await fetch("");
phiresky /
Last active Apr 15, 2020
guitar synthesizer in 96 characters of C

tiny guitar synth in 96 chars of C

works by starting with a array filled with white noise (from /dev/urandom), then continuously modulating it with a low pass filter of the desired frequency.

this results in a sound pretty similar to a guitar with steel or nylon strings.

phiresky / client.ts
Last active Apr 9, 2020
koa example of a somewhat sane typed http server
View client.ts
import { makeClient } from "./makeTypedApi";
import { Api } from "./common";
const api = makeClient(Api);
// has all the HTTP methods like normal methods, e.g.
const results = await api.byDate()
mkdir -p "$cachedir"
mtime="$(stat -c %Y "$1")"
hash=$(echo $fname.$mtime | sha256sum | cut -c1-64)
phiresky / nginx.conf
Last active Mar 20, 2020
Log as much information as possible in nginx to json format
View nginx.conf
http {
log_format json_combined escape=json
'"time_iso8601":"$time_iso8601", "remote_addr":"$remote_addr", "remote_user":"$remote_user", "request":"$request",'
'"status": "$status", "body_bytes_sent":"$body_bytes_sent", "request_time":"$request_time","http_host":"$http_host","host":"$host",'
'"http_referrer":"$http_referer", "http_user_agent":"$http_user_agent",'
'"upstream_connect_time": "$upstream_connect_time", "upstream_response_time":"$upstream_response_time"'
phiresky /
Last active Jun 6, 2019
zsh histdb example data filler

run in a somewhat interesting dir (e.g. checkout of a linux kernel) with <100k files (otherwise too slow).

mv -i ~/.histdb/zsh-history.db ~/.histdb/realhistory

./ | sqlite3 ~/.histdb/zsh-history.db
phiresky /
Last active May 29, 2019
qdirstat server script

Use this to run qdirstat for a server on which it is not installed:

ssh root@server 'curl -sL | perl -- - / -' | qdirstat -c /dev/stdin

Yes, the arguments to perl are perl -- - dir_to_scan -. Beautiful, isn't it?

phiresky / .gitignore
Last active Mar 30, 2019
fusl script
View .gitignore
You can’t perform that action at this time.