Skip to content

Instantly share code, notes, and snippets.

vi /
Created August 22, 2023 02:37
Converter from twitchchatdownloader to srt.
#!/usr/bin/env -S cargo +nightly -Zscript
//! Convert Twitch subtitles exported as CSV from to srt format
//! ```cargo
//! [package]
//! edition="2021"
//! [dependencies]
//! csv = "1"
vi / pbcopy_html.swift
Created June 24, 2023 23:32
Command line tool, like `xclip -in -t text/html` for Mac. For preparing content for Google Docs/Sheets.
#!/usr/bin/env swift
// Based on
import Cocoa
import Foundation
let pasteboard: NSPasteboard = .general
let dataTypeName : String = "public.html"
vi / Cargo.toml
Created December 18, 2022 20:14
Rust async executor abuse to avoid both blocking and threads (v2)
name = "hackyws"
version = "0.1.1"
edition = "2021"
anyhow = "1.0.66"
async-tungstenite = "0.18.0"
flume = "0.10.14"
vi / Cargo.toml
Last active June 19, 2023 20:03
Rust async executor abuse to avoid both blocking and threads
name = "hackyws"
version = "0.1.0"
edition = "2021"
anyhow = "1.0.66"
async-executor = "1.5.0"
async-tungstenite = "0.18.0"
vi /
Last active October 28, 2022 09:38
Hacky workaround to track new stars of your repositoes (previously displayed on Github home page)
set -e
D=$(mktemp -d)
cd "$D"

Keybase proof

I hereby claim:

  • I am vi on github.
  • I am vi0oss ( on keybase.
  • I have a public key whose fingerprint is 5CF2 87F9 4EE8 ECD6 B68A B0AC 0FF5 8BF9 3D7B 965F

To claim this, I am signing this object:

vi /
Last active April 27, 2024 22:00
List of crates that improves or experiments with Rust, but may be hard to find

Let's list here crates that enhance Rust as a language.

It not "batteries" like in stdx, but Rust-specific crates for workarounds for various missing features and experimental ideals from non-accepted/postponed RFCs, or just hacky tricks.

The list is supposed to contain (mostly) crates that are internal to Rust, not ones for making Rust deal with "external world" like other languages bindings, file formats, protocols and so on.

Primary focus should be on crates that are not easy to find by conventional means (e.g. no algorithm name, format or protocol to search for).

Note that quality of the listed crates may vary from proof-of-concept to stable-and-widely-used.

vi / png2yuva
Created September 13, 2019 20:39
Convert RGBA pictures to bigger grayscale picure showing colour planes and back using FFMpeg
S=$(identify "$1" | cut -d' ' -f 3-3)
IFS=x SS=($S)
ffmpeg -v warning -i "$1" -pix_fmt yuva444p -f rawvideo - | ffmpeg -v warning -pix_fmt gray -s ${W}x$((H*4)) -f rawvideo -i - -y "$2"
vi / mvimg_mpv
Created August 11, 2019 22:37
Shell script to play Google Motion Photos with mpv from command line
if [[ -z "$1" || "$1" == --help || "$1" == "-?" ]]; then
echo "Usage: mvimg_play MVIMG_20190806_183324.jpg [other files]"
echo "Plays Google's Motion Photo using mpv. Depends on exiftool, mktemp, bash and mpv."
exit 0
vi /
Last active December 5, 2022 14:40
Video-enhanced script.
true ${SD_PARAMS:="-55dB:d=0.3"};
if [ -z "$OUT" ]; then