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 numpy as np | |
from scipy.signal.windows import hamming | |
class Joy: | |
def __truediv__(cls, arr): | |
T, N = arr.shape | |
spacer = 2 * np.arange(N) | |
t = np.arange(T) | |
window = hamming(T) | |
normed = (arr - arr.mean(0)) / (1e-3 + arr.std(0)) |
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 argparse as ap | |
from pathlib import Path | |
import ffmpeg | |
def compress(in_file): | |
out_file = in_file.parent / (in_file.stem + ' (1440p)' + in_file.suffix) | |
opts = { | |
'c:a': 'copy', | |
'c:v': 'libx265', | |
'crf': '24', |
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/env python | |
import argparse as ap | |
import re | |
import requests | |
import json | |
from tempfile import TemporaryFile | |
from zipfile import ZipFile | |
def main(project_path, ksp_path): |
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
ports=$(lsof -t -i tcp:$1); | |
for port in $ports; do | |
echo "killing PID $port"; | |
kill $port; | |
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
# Beware! This file is rewritten by htop when settings are changed in the interface. | |
# The parser is also very primitive, and not human-friendly. | |
fields=0 48 17 18 38 39 40 2 46 47 49 1 | |
sort_key=46 | |
sort_direction=-1 | |
hide_threads=0 | |
hide_kernel_threads=1 | |
hide_userland_threads=0 | |
shadow_other_users=0 | |
show_thread_names=0 |
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/env python | |
# Drop this in your ~/bin folder and chmod u+x it for maximum slickness | |
import click | |
import boto3 | |
import subprocess | |
ec2 = boto3.resource('ec2') | |
def instances_by_name(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
import argparse as ap | |
if __name__ == "__main__": | |
parser = ap.ArgumentParser() | |
parser.add_argument('f', type=float, help="Overall focal length") | |
parser.add_argument('library', type=int, nargs='+', help="Focal length of available lenses") | |
args = parser.parse_args() | |
f = args.f | |
fs = args.library |
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
# Place this in ~/.config/systemd/user | |
[Unit] | |
Description=Code Server IDE | |
After=network.target | |
[Service] | |
Type=simple | |
EnvironmentFile=/home/ubuntu/.profile | |
WorkingDirectory=/home/ubuntu | |
Restart=on-failure |
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
# Set transparent background default line colors to white. | |
lines.color: white | |
patch.edgecolor: white | |
text.color: white | |
axes.facecolor: ffffff00 | |
axes.edgecolor: white | |
axes.labelcolor: white |
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
ffmpeg -pattern_type glob -i "img *.png" -c:v libx264 -crf 18 -pix_fmt yuv420p -preset slow -r 60 out.mp4 |
NewerOlder