https://mitxela.com/projects/dotfiles_management
alias dotfiles='git --git-dir=/home/mx/.dotfiles --work-tree=/'
dotfiles config --local status.showUntrackedFiles no
git ls-files -c -o -z --exclude-standard | xargs -0 file --mime-type | grep 'text/' | cut -d: -f1 | xargs -I{} sh -c 'echo \<file name=\"{}\"\>; cat {}; echo \<\/file\>' |
#!/usr/bin/env python | |
import subprocess | |
from pathlib import Path | |
output = subprocess.run(['git', 'ls-files'], stdout=subprocess.PIPE, text=True, check=True) | |
paths = [Path(path) for path in output.stdout.strip().split('\n')] | |
for path in paths: | |
print(path) |
data:text/html,<body contenteditable style=font-family:monospace;line-height:1.5;font-size:24px><script> window.onbeforeunload = function(e) { e.preventDefault();return ''; }; </script> |
$ defaults write -g InitialKeyRepeat -int 13 | |
$ defaults write -g KeyRepeat -int 1 |
$ ipython | |
Python 3.8.4 (v3.8.4:dfa645a65e, Jul 13 2020, 10:45:06) | |
Type 'copyright', 'credits' or 'license' for more information | |
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help. | |
In [1]: from langchain.agents import Tool, initialize_agent | |
...: from langchain.agents import load_tools | |
...: from langchain.llms import OpenAI | |
...: |
https://mitxela.com/projects/dotfiles_management
alias dotfiles='git --git-dir=/home/mx/.dotfiles --work-tree=/'
dotfiles config --local status.showUntrackedFiles no
from itertools import cycle, slice | |
fizz = cycle('', '', 'fizz') | |
buzz = cycle('', '', '', '', 'buzz') | |
pairs = zip(fizz, buzz) | |
for pair in slice(pairs, 30): | |
print(' '.join(pair)) |
# Convert .m4v to .mp4 | |
$ ffmpeg -i input.m4v -c:v libx264 -c:a aac output.mp4 | |
# Convert .mp4 to .webm | |
$ ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -b:a 128k -c:a libopus output.webm |
html { | |
max-width: 70ch; | |
padding: calc(1vmin + .5rem); | |
margin-inline: auto; | |
font-size: clamp(1em, 0.909em + 0.45vmin, 1.25em); | |
font-family: system-ui; | |
} | |
body { | |
line-height: 1.6; | |
} |
"""Simple TCP Proxy | |
Receive connections on one port and forward them to another port. | |
Example: | |
$ python3 -m http.server 8080 # Start an http server on port 8080 | |
$ python3 tcp_proxy.py 5000 8080 # Proxy port 5000 to 8080 | |
Open http://localhost:5000/ in Chrome |