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
""" | |
Usage: | |
python jfixer.py masm.txt | |
Put `label` instructions in your code: | |
label here | |
... | |
jump here ... |
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 unicodedata | |
from random import randint, choice | |
def getcharset(): | |
hira = [chr(i) for i in range(ord('ぁ'), ord('ゟ') + 1)] | |
rs = [] | |
for ch in hira: | |
try: | |
n = unicodedata.name(ch) |
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 bisect import bisect_right | |
from typing import Optional, Set | |
class CoinStack: | |
def __init__(self): | |
self._coins = [] | |
self._sum = 0 | |
def put(self, coin): |
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
""" | |
Util to fix names in zip files created under Windows. | |
Usage: | |
First decide whether you really need to fix your archive, | |
or whether this program is able fix it correctly | |
(operation is read-only): | |
python fix_zip.py archive.zip |
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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("gamedev.ru") { | |
div.mes { | |
padding: 2pt 4pt 0; | |
border: none; | |
margin-bottom: 20pt; | |
/* box-shadow: #f5f5f5 0 4pt 3pt -3pt; */ | |
border-top: 2pt solid #f6f6f6; | |
} |
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
maps\ladder\(4)Ashrigo.scm | |
[48, 28], [35, 29], [86, 29], [87, 29], [91, 29], [93, 45], [56, 54], [57, 54] | |
[60, 66], [76, 67], [77, 67], [74, 70], [75, 70], [24, 71], [25, 71], [26, 76] | |
[24, 79], [25, 79], [60, 87], [61, 87], [59, 88], [58, 89], [59, 89], [56, 99] | |
[57, 99], [38, 104], [39, 104], [40, 107], [62, 114], [64, 116], [64, 117] | |
[65, 117] | |
maps\ladder\(4)Lost Temple.scm | |
[28, 93], [80, 97] | |
maps\oldladder\(2)Discovery.scm | |
[68, 58], [74, 64] |
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 pickle | |
import weakref | |
from contextlib import contextmanager, suppress | |
from datetime import datetime | |
from itertools import islice | |
from logging import getLogger | |
from pathlib import Path | |
from libqtile import bar, hook, layout, widget | |
from libqtile.command import lazy |
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 math import floor | |
from collections import defaultdict | |
from itertools import count | |
class TooHighLevelException(Exception): | |
pass | |
def make_number(p, level): |
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
# You need to define three functions to handle persistence of couple of values: | |
# load_resume_point() -> Optional[Tuple[str, int]] | |
# save_resume_point(str, int) -> None | |
# clean_resume_point() -> None | |
media = MediaFileUpload('pig.png', mimetype='image/png', resumable=True) | |
request = farm.animals().insert(media_body=media, body={'name': 'Pig'}) | |
# if you have previously acquired resume point | |
rp = load_resume_point() |