Skip to content

Instantly share code, notes, and snippets.

@Zemke
Zemke / waaas_getvideo.sh
Created June 3, 2023 17:26
cURLing WAaaS getvideo endpoint
boggy@waaas curl -X POST 'http://localhost:8080/getvideo' -F 'replay=@game.WAgame' -F 'x=1920' -F 'y=1080' -F 'fps=1' -F 'start=100' -F 'end=105'
9asfpl8d
boggy@waaas curl -X GET 'http://localhost:8080/getvideo/9asfpl8d/status'
{"done": false, "ready": 6, "expected": 5, "progress": 1.2, "remaining": 0, "estimate_s": 0, "zero_indexed": true}
boggy@waaas curl -X GET 'http://localhost:8080/getvideo/9asfpl8d/status'
{"done": false, "ready": 6, "expected": 5, "progress": 1.2, "remaining": 0, "estimate_s": 0, "zero_indexed": true}
@Zemke
Zemke / np_grid.py
Last active August 2, 2022 19:03
image grid with numpy
# unordered
# c = color channel if available
np.concatenate(np.reshape(img, (img_rows,-1,img_width,c), axis=1)
# ordered
# n = number of tiled images that should make up a row in the grid
np.vstack([np.concatenate(img[i:i+n], axis=1) for i in range(0, len(img), n)])
set search_path = "db10838396-cwt";
CREATE OR REPLACE FUNCTION timeline(bigint)
RETURNS TABLE
(
timeline text
)
ROWS 1
LANGUAGE SQL
AS
@Zemke
Zemke / beautiful-soup.py
Last active March 30, 2018 18:02
Takes an HTML file or a path to recursively associate input fields and labels using `id` and `for` attributes.
import os
import re
import sys
from typing import IO
from bs4 import BeautifulSoup
from bs4.element import Tag
if len(sys.argv) == 2:
argv_path = sys.argv[1]