Skip to content

Instantly share code, notes, and snippets.

View neumond's full-sized avatar
🐢
I may be slow to respond.

neumond

🐢
I may be slow to respond.
View GitHub Profile
@neumond
neumond / jfixer.py
Created December 21, 2020 09:49
Mindustry jump to label
"""
Usage:
python jfixer.py masm.txt
Put `label` instructions in your code:
label here
...
jump here ...
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)
@neumond
neumond / coins.py
Created January 6, 2019 16:18
Possible combinations of coins to assemble some amount
from bisect import bisect_right
from typing import Optional, Set
class CoinStack:
def __init__(self):
self._coins = []
self._sum = 0
def put(self, coin):
@neumond
neumond / fix_zip.py
Last active July 12, 2020 16:05
Util to fix names in zip files created under Windows
"""
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
@neumond
neumond / gd.css
Last active February 26, 2017 22:42
gamedev.ru style
@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;
}
@neumond
neumond / gist:79dbd52abcf80db4afabf309c32c8f17
Created December 29, 2016 05:22
isBuildable but not isWalkable
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]
@neumond
neumond / qtileconfig.py
Last active August 30, 2021 14:36
My qtile config
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
@neumond
neumond / bsynth.py
Last active February 10, 2018 13:05
[Possibly] minimal brainfuck code to output given string
from math import floor
from collections import defaultdict
from itertools import count
class TooHighLevelException(Exception):
pass
def make_number(p, level):
@neumond
neumond / upload.py
Last active June 16, 2017 12:08
Resumable MediaFileUpload
# 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()