Skip to content

Instantly share code, notes, and snippets.

View wvxvw's full-sized avatar

Fuck Github wvxvw

View GitHub Profile
@wvxvw
wvxvw / pypa-problems.org
Last active May 4, 2023 00:53
Draft about Python infrastructure problems

Goals and Metrics

Before evaluating different tools and approaches it’s important to make explicit the objectives and the measure of success.

Most importantly, a program needs to be correct enough to be useful. The “enough” aspect of this usefuleness is the reliability of the program. A non-trivial program will typically have infinitely many possible results for similarly infinitely many inputs. The relationship between the subset of the inputs for which the program is correct and the set of plausible inputs is captured

@wvxvw
wvxvw / setup.py
Created January 30, 2019 16:09
Generic top-level setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import subprocess
import shutil
from tempfile import TemporaryDirectory
from glob import glob
@wvxvw
wvxvw / init-python.el
Last active February 25, 2018 08:19
Some Python mode goodies
(defun wvxvw/python-align-fargs--find ()
(save-excursion
(search-backward "(")
(while (eql (face-at-point t) 'font-lock-string-face)
(search-backward "("))
(let* ((begin (point))
(end (save-excursion (progn (forward-sexp) (point))))
(args-begin
(progn
(forward-char)
@wvxvw
wvxvw / Kakuro solver
Created December 18, 2017 14:05
Simple Kakuro solver in Prolog
% -*- mode: prolog -*-
:- use_module(library(clpfd)).
extract_rows([], [], X, Y) :- maplist(reverse, X, Y).
extract_rows([], Y, X, Z) :-
not(Y = []),
maplist(reverse, [Y | X], Z).
extract_rows([X | Xs], Row, Acc, Rows) :-
ground(X),
#!/bin/bash
i=0
mkdir -p /tmp/vod
while [ $i -lt 1200 ]; do
file="media_b1200000_$i.ts"
echo "saving to: <$file>"
curl "http://openuvd01.vds-is.bynetcdn.com/vod/mp4:vod/openu/PRV1/Ht9javLOiu/App/Ht9javLOiu_2.mp4/$file" \
-H 'Host: openuvd01.vds-is.bynetcdn.com' \
-H 'User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0' \