Skip to content

Instantly share code, notes, and snippets.

@krashanoff
krashanoff / get_info.py
Last active May 2, 2021 07:09
Simple program to pretty-print a request to YouTube's `get_video_info` endpoint.
#!/usr/bin/python3
# Leo Krashanoff
# (c) 2021
# Subject to contents of MIT License
#
# Originally written for maguro: https://github.com/krashanoff/maguro
from urllib.parse import parse_qs, unquote
from requests import get
// twdl
//
// A Deno script for downloading images you like on Twitter.
//
import { parse } from "https://deno.land/std@0.104.0/flags/mod.ts";
import { copy, readerFromStreamReader } from "https://deno.land/std@0.104.0/io/mod.ts";
const { name = null, count = 200, out = "out", fmt = "", ...args } = parse(Deno.args);
if (!name) {
@krashanoff
krashanoff / pointer_aliasing.go
Created January 19, 2024 23:06
Simple program to demonstrate Go's iterator aliasing.
package main
import "fmt"
type A struct {
b int
}
func main() {
theAs := []A{}

Handy FFMPEG Things

I'll try to update this.

Compressing a MOV

MOV captures from your Mac are really large, usually. This makes it into a nice GIF with a timecode in the corner.

ffmpeg -i capture.mov \
@krashanoff
krashanoff / echo2b64.go
Created May 31, 2024 05:57
HTTP server to echo back your HTTP request body in Base64. Useful for writing AWS Lambda tests.
package main
import (
"encoding/base64"
"io"
"net/http"
"os"
)
type EchoReader struct {