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/fish | |
# | |
# (c) 2024, Tremeschin, MIT License | |
# | |
# smartenv - Automatically source Python virtualenvs in a smart way (plus monorepo support) | |
# | |
# Usage: Add this file to ~/.config/fish/conf.d/smartenv.fish and restart your shell | |
# Speed: Inside venv `hyperfine 'rye show' -i`: 10ms; Outside venv: 2.3ms (SSD + Beefy CPU) | |
# Note: This script needs [rye](https://rye.astral.sh/) to be installed and on PATH | |
# |
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") |