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 re | |
# Umrechnungsfaktoren | |
BIN_PREFIX = {"ki": 1024, "mi": 1024**2, "gi": 1024**3, "ti": 1024**4, | |
"pi": 1024**5, "ei": 1024**6, "zi": 1024**7, "yi": 1024**8} | |
DEC_PREFIX = {"k": 1000, "m": 1000**2, "g": 1000**3, "t": 1000**4, | |
"p": 1000**5, "e": 1000**6, "z": 1000**7, "y": 1000**8} | |
# Regex zum Parsen der Eingabe | |
pattern = re.compile(r"^(\d+)([kmgtpezy]?i?)(bit|byte)$", re.IGNORECASE) |
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/zsh | |
# Check if the correct number of arguments is provided | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: $0 <directory> <password>" | |
exit 1 | |
fi | |
# Read arguments | |
ARCHIVE_DIR="$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
# MicroPython USB Mouse module with Scroll Wheel | |
# MIT license; Copyright (c) 2023-2024 Angus Gratton | |
from micropython import const | |
import struct | |
import machine | |
from usb.device.hid import HIDInterface | |
_INTERFACE_PROTOCOL_MOUSE = const(0x02) |
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 | |
# run some program, and KILL it with deadly force upon ^C :) --sq5bpf | |
# this is a hack to make | |
CPID=0 | |
intr() { | |
echo "killing $CPID" | |
kill -9 $CPID | |
} |
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
<code_scheme name="Default" version="173"> | |
<JSCodeStyleSettings version="0"> | |
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" /> | |
<option name="FORCE_SEMICOLON_STYLE" value="true" /> | |
<option name="SPACE_BEFORE_GENERATOR_MULT" value="true" /> | |
<option name="REFORMAT_C_STYLE_COMMENTS" value="true" /> | |
<option name="USE_DOUBLE_QUOTES" value="false" /> | |
<option name="FORCE_QUOTE_STYlE" value="true" /> | |
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" /> | |
<option name="SPACES_WITHIN_IMPORTS" value="true" /> |
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 | |
# Removes old revisions of snaps | |
# CLOSE ALL SNAPS BEFORE RUNNING THIS | |
set -eu | |
LANG=C snap list --all | awk '/disabled/{print $1, $3}' | | |
while read -r snapname revision; do | |
snap remove "$snapname" --revision="$revision" | |
done |
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
" Settings | |
set nohud | |
set nosmoothscroll | |
set noautofocus " The opposite of autofocus; this setting stops | |
" sites from focusing on an input box when they load | |
set typelinkhints | |
let searchlimit = 30 | |
let scrollstep = 70 | |
let barposition = "bottom" |
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 cProfile | |
from datetime import datetime | |
def profileit(func): | |
def wrapper(*args, **kwargs): | |
datafn = f"{func.__name__}_{datetime.now().strftime('%Y%m%d_%H%M%S_%f')}.profile" | |
prof = cProfile.Profile() | |
retval = prof.runcall(func, *args, **kwargs) | |
prof.dump_stats(datafn) |
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
// ==UserScript== | |
// @name Track Pageview | |
// @namespace deKexx | |
// @description Sends Url to a local server | |
// @include http://www.youtube.com/watch* | |
// @include https://www.youtube.com/watch* | |
// @connect popo.local | |
// @author Jan Zeiseweis | |
// @version 0.1 | |
// @grant GM_xmlhttpRequest |
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 pickle | |
from pathlib import Path | |
from flask import Flask, request | |
app = Flask(__name__) | |
seen_video_ids_path = Path("video_ids.pkl") | |
if seen_video_ids_path.is_file(): | |
with open(str(seen_video_ids_path), 'rb') as dump: |
NewerOlder