This file contains hidden or 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
| """ | |
| $ python main.py h265 config --width 1280 --height 720 h264 --preset veryfast aac --bitrate 20 aac --bitrate 50 | |
| Scene(ffmpeg=FFmpeg(vcodec=H264(preset='veryfast', crf=23), acodec=AAC(bitrate=50)), config=Config(width=1280, height=720)) | |
| """ | |
| import contextlib | |
| import itertools | |
| import sys | |
| from typing import Annotated, Any, Union |
This file contains hidden or 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/env python3 | |
| # fmt: off | |
| # Todo: Find a new name, write proper package | |
| from pathlib import Path | |
| DIVISOR = "# <!-- AUTOMATIC -->" | |
| HOME = Path().home() |
This file contains hidden or 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 time | |
| import numpy as np | |
| np.set_printoptions(threshold=np.inf, precision=2, suppress=True) | |
| matrix_size = 5 | |
| # ---------------------------------------------------------------------------- # | |
| def fit_depthmap( | |
| original: np.ndarray, |
This file contains hidden or 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 random import randint as r | |
| X,Y,M,W=[5],[5],(4,2),10 | |
| while 1: | |
| G=[["."]*W for _ in range(W)] | |
| G[M[1]][M[0]]='*' | |
| for x,y in zip(X,Y):G[y][x]='#' | |
| for R in G:print(''.join(R)) | |
| while not(i:=input()):pass | |
| x,y=(i=="d")-(i=="a"),(i=="s")-(i=="w") | |
| X.insert(0,X[0]+x);Y.insert(0,Y[0]+y) |
This file contains hidden or 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/bash | |
| # | |
| # (c) 2024, Tremeschin, MIT License | |
| # | |
| # pacsync - Synchronize a whitelist of packages on an Arch Linux system | |
| # | |
| # This scripts remove all non-related and non-dependencies of a package list, acting like a lock | |
| # mechanism to match the system with a list of allowed packages, 'pacman.lock' vibes | |
| # | |
| # Usage: Add this file to your PATH or as a bash function, then run: |
This file contains hidden or 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 random as r | |
| w=r.choice(input("enter csv of words: ").split(",")) | |
| d,t,a=["_"for n in w],5,[] | |
| while t>0: | |
| exit(w)if''.join(d)==w else print(''.join(d)) | |
| c=input(f"{t}t:") | |
| for p in[p for p,v in enumerate(w)if c==v]:d[p]=w[p] | |
| t-=0 if c in w else 1 |
This file contains hidden or 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 numpy as n | |
| g,p,w=n.array([[0]*3]*3),1,"-OX" | |
| while True: | |
| for r in g: print(' '.join(w[x]for x in r)) | |
| c,p=int(input(w[-p])),-p | |
| g[divmod(c-1,3)]=p | |
| s=n.concatenate((n.sum(g,axis=0),n.sum(g.T,axis=0),[sum(g.diagonal())],[sum(n.fliplr(g).diagonal())])) | |
| if e:=w[1]if 3 in s else w[2]if-3 in s else 0: exit(e+"wins") |