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 python3 | |
import re | |
import subprocess | |
RE_SPELLCHECK_DISABLE = re.compile("spell-checker:disable-\w+") | |
CACHED_FILES_STRING = None | |
def check_right_directory(): |
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 python3 | |
# Usage: python3 randombeeps.py | aplay -f cd | |
import math | |
import random | |
import struct | |
import sys | |
MIN_FREQ_HERTZ = 100 |
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
aaabf # Part of a commit | |
aarch | |
Aarch | |
ABCD | |
abefrnt # list of shortargs | |
abench | |
ABI | |
abrt | |
Absolutize | |
AcceptSocketConnections |
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
// g++ -O2 -std=c++20 -o foo repro.cpp && ./foo | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct Vector { | |
~Vector() {} | |
char* data() { | |
if (m_outline) | |
return m_outline; | |
return reinterpret_cast<char*>(m_inline); |
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 python3 | |
from PIL import Image | |
import math | |
import time | |
SIZE = (400, 300) | |
TOTAL_TIME = 40 |
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 python3 | |
# Put this file in Meta/ | |
from collections import defaultdict, Counter | |
import os | |
import random | |
import re | |
import subprocess | |
import sys |
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
Example "FULL BLOCK": ██████.de = xn--4zhaaaaa.de | |
Example "SEVEN EIGHTS BLOCK": ▇▇▇▇▇▇.de = xn--3zhaaaaa.de | |
https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains | |
Registrars tat don't work: | |
- DENIC (and thus *.de): Allows only hand-selected Unicode characters. | |
- Verisign (*.net, *.com): Doesn't let me paste it, even though Wikipedia claims it's supported | |
- .org: Says "Invalid entry", refuses to elaborate, even though Wikipedia claims it's supported | |
- OVH: kann's nicht. |
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/python3 | |
# Example usage: | |
# $ ./video_cut.py lectXX-raw.mp4 lectXX-cut.mp4 00:07:59 00:56:48 01:06:26 01:56:59 | |
# $ ffmpeg -i lectXX-cut.mp4 -c:v libx264 -preset slow -crf 23 lectXX.mkv # Re-encode (to save some space; make "23" higher for higher compression and lower quality) | |
# $ chmod -w lectXX.mkv | |
# $ rsync -Pv lectXX.mkv ${USER}@contact.mpi-inf.mpg.de:/www/inf-resources-0/download.mpi-inf.mpg.de/d1/tkids/ | |
# And maybe remove write permissions, to prevent future mistakes. | |
import re |
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 python3 | |
# Want: | |
# * Initially, uniform random distribution | |
# * If new elements appear, they are likely to be picked | |
# * If an element is picked, it is unlikely to be picked again soon | |
# * Long-ago-elements are roughly of the same probability (prevent permutation-lock) | |
# So: | |
# - Among new elements, pick uniform. |
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 python3 | |
# Based on https://gist.github.com/bonsaiviking/5639034 | |
# Converted to Python3 by hand. | |
import struct | |
def leftrotate(i, n): | |
return ((i << n) & 0xffffffff) | (i >> (32 - n)) |
NewerOlder