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 | |
"""Encode arbitrary strings with ANSI background coloring.""" | |
from argparse import ArgumentParser, Namespace | |
from sys import stdin, stdout | |
RESET = '\x1b[0m' | |
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 | |
"""Hangman game.""" | |
from os import linesep | |
from string import ascii_letters | |
from sys import exit, stderr | |
from typing import Iterator | |
class GameOver(Exception): |
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 | |
"""Find for- and while-loops with else clauses.""" | |
from ast import For, Module, While, parse, walk | |
from logging import getLogger | |
from pathlib import Path | |
from typing import Iterator | |
LOGGER = getLogger(__file__) |
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 | |
"""Generator of generators demo.""" | |
from typing import Iterator, Sequence | |
def npowers(numbers: Sequence[int]) -> Iterator[Iterator[int]]: | |
"""Yield n generators of the n-power of | |
numbers with n being the amount of numbers. |
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
{ | |
"dayz": { | |
"app_id": 1042420, | |
"base_dir": "/srv/dayz", | |
"params": { | |
"profiles_dir": "profiles", | |
"no_file_patching": false | |
}, | |
"mods": [ | |
{ |
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
From 57c73151fe6d8600bb9bc6862781f63541f28cd8 Mon Sep 17 00:00:00 2001 | |
From: Richard Neumann <[email protected]> | |
Date: Tue, 18 Jan 2022 18:50:33 +0100 | |
Subject: [PATCH] Add "aint" keyword as alternative to "is not" | |
--- | |
Grammar/python.gram | 4 +- | |
Parser/parser.c | 294 ++++++++++++++++++++++++-------------------- | |
2 files changed, 164 insertions(+), 134 deletions(-) |
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
from collections import defaultdict | |
from functools import partial | |
from json import dumps | |
from random import * | |
l = [5, 1, 2, 7, 4] | |
f = lambda x: [i for _, i in sample(list(enumerate(x)),k=randrange(len(x))+1)] | |
def g(a): |
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 | |
"""Check whether the running kernel equals the installed kernel package.""" | |
from argparse import ArgumentParser, Namespace | |
from logging import INFO, WARNING, basicConfig, getLogger | |
from subprocess import check_output | |
from sys import exit # pylint: disable=W0622 | |
from typing import NamedTuple, Optional | |
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 | |
# | |
# pjdb.py - JSON-ify pacman databases. | |
# | |
# (C) 2021 Richard Neumann <mail at richard dash neumann period de> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 3. | |
# |
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
#include <chrono> | |
using std::chrono::duration; | |
using std::chrono::system_clock; | |
#include <future> | |
using std::async; | |
using std::launch; | |
#include <iostream> | |
using std::cout; |
NewerOlder