This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sequences import * | |
class ai_class: | |
def __getitem__(self, items): | |
if items[-1] is not Ellipsis: | |
yield from items | |
return | |
expression = find_sequence(items[:-1]) | |
yield from items[:-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user="louisswarren" | |
github="https://api.github.com" | |
pyjsonlines="'\n'.join(r[sys.argv[-1]] for r in json.loads(sys.stdin.read()))" | |
pycmd="import sys, json; print($pyjsonlines)" | |
curl -s "$github/users/$user/repos" | python3 -c "$pycmd" git_url | | |
while read x; do | |
git clone "$x" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
sum = lambda x: list(itertools.accumulate(x)).pop() | |
len = lambda x: sum(1 for _ in x) | |
range = lambda n, step=1: itertools.accumulate(itertools.repeat(step, times=n-1), lambda x, y: x + y) | |
# Full implementation | |
range = lambda min, max=None, step=1: itertools.accumulate(itertools.chain((min if max is not None else 0,), | |
itertools.repeat(step, (max-min-1)//step if max is not None else None))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
front = 16,1,14,3,12,5,10,7 | |
back = 4,13,2,15,8,9,6,11 | |
for x in range(4): | |
print("Sheet", x + 1) | |
for side in front, back: | |
print(',\t'.join(str(p + 16*x) for p in side)) | |
print() | |
# Sheet 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.mp4; do | |
target="${f%.mp4}.mp3" | |
ffmpeg -i "$f" -vn -acodec libmp3lame -ac 2 -ab 320k -ar 48000 "$target" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from util import * | |
class Obj: | |
@constructor | |
def __init__(self, name): | |
pass | |
def __str__(self): | |
return str(self.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Set mouse sensitivity | |
inputnum=`xinput list | grep -oE "USB OPTICAL MOUSE.*id=[0-9]+" | grep -oE "[0-9]+" | head -n 1` | |
propnum=`xinput list-props "$inputnum" | grep -oE "Coordinate Transformation Matrix \([0-9]+\)" | grep -oE "[0-9]+"` | |
xinput set-prop "$inputnum" "$propnum" "$1" 0 0 0 "$1" 0 0 0 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module demo where | |
-- Natural numbers | |
data ℕ : Set where | |
zero : ℕ | |
suc : ℕ → ℕ | |
{-# BUILTIN NATURAL ℕ #-} | |
infix 5 _+_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import sys | |
import os | |
import time | |
filename = '/home/louis/minlog/.guileman.txt' | |
f = open(filename, 'w') | |
f.write('\n') | |
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prepositions = """ | |
aboard, about, above, across, after, against, along, amid, among, anti, | |
around, as, at, before, behind, below, beneath, beside, besides, between, | |
beyond, but, by, concerning, considering, despite, down, during, except, | |
excepting, excluding, following, for, from, in, inside, into, like, minus, | |
near, of, off, on, onto, opposite, outside, over, past, per, plus, | |
regarding, round, save, since, than, through, to, toward, towards, under, | |
underneath, unlike, until, up, upon, versus, via, with, within, without | |
""".split(', ') |