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 | |
'''brainfuck interpreter in a single generator expression | |
im sorry''' | |
def bf(code): | |
all( | |
# we need to yield *something* |
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 | |
''' | |
Generate G-code for drawing a Sierpenski triangle, using lines, | |
only drawing each line once, and never lifting the tool. | |
This is achieved drawing along an Eulerian cycle | |
''' |
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
#elif defined(DF_04704) | |
#ifdef WIN32 | |
#define A_LOAD_MULTI_PDIM 0x140c1f670 | |
#define A_RENDER_MAP 0x1409d8200 | |
#define A_RENDER_UPDOWN 0x1406f0090 | |
static patchdef p_display = { 0x140479beb, 5 }; | |
static patchdef p_dwarfmode_render = { 0x14042d93a, 5 }; |
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 random | |
from quodlibet import _ | |
from quodlibet.plugins.playorder import ShufflePlugin | |
from quodlibet.qltk import Icons | |
from quodlibet.util import print_d | |
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 | |
'''Simplify MP3 ID3 tags for android compatibility | |
Converts tags to 2.4, utf8, and strips extended headers | |
''' | |
from eyed3.id3 import Tag, ID3_V2_4 | |
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
#!/bin/sh | |
# if systemd is used and you need sound, login to $console prior https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747882 | |
# if you can't stand cursor bug, start this script from console, not another X https://bugs.launchpad.net/ubuntu/+source/plasma-workspace/+bug/1684240 | |
# for many games you need running window manager, in that case run script which runs both wm and game via this script | |
display=1 | |
console=3 | |
tmpdir=$XDG_RUNTIME_DIR/nvidia | |
busid=$(/usr/bin/lspci | awk '/(3D)|(VGA compatible) controller: NVIDIA/{gsub(/\./,":",$1); print $1}') |
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 hashlib | |
import xml.etree.ElementTree as ET | |
from itertools import islice | |
import r2pipe | |
def md5(path, block_size=2**20): |
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/joel-wright/68fc3031cbb3f7cd25db1ed2fe656e60 | |
import os | |
import time | |
from pathlib import Path | |
from functools import lru_cache |
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
$ python3 unicode_test.py | |
Running test on 3.5.3 (default, Jan 19 2017, 14:11:04) | |
[GCC 6.3.0 20170118] | |
Running with locale encoding 'UTF-8'... | |
Success | |
$ python2 unicode_test.py | |
Running test on 2.7.13 (default, Jan 19 2017, 14:48:08) | |
[GCC 6.3.0 20170118] | |
Running with locale encoding 'UTF-8'... |
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 pip._vendor import packaging | |
from packaging.specifiers import SpecifierSet | |
tests_good = [ | |
'0.99999999', | |
'0.999999999', | |
'1.0b9', | |
'1.0b10', |
NewerOlder