$ git remote add upstream git@github.com:mbedmicro/mbed.git
$ git fetch upstream
$ git merge upstream/master
$ git push
$ git remote add xxx_work git@github.com:mbedmicro/mbed_private_xxx.git
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 Text.Pandoc.JSON | |
import Data.List | |
main :: IO () | |
main = toJSONFilter myfilter | |
myfilter (Link _ text (url, _)) | |
| '#':ref <- url | |
= Span nullAttr $ | |
text <> |
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
# convert yaml to json | |
# pip3 install pyyaml | |
# http://pyyaml.org/wiki/PyYAMLDocumentation | |
# py3 yaml2json.py < ~/code/manpow/homeland/heartland/puphpet/config.yaml | |
# gist https://gist.github.com/noahcoad/51934724e0896184a2340217b383af73 | |
import yaml, json, sys | |
sys.stdout.write(json.dumps(yaml.load(sys.stdin), sort_keys=True, indent=2)) |
(For English readers: please read https://github.com/sponsors/tk0miya instead)
@tkomiya は、日本在住の OSS 開発者です。
趣味として Sphinx や pycmark、 blockdiag などの OSS の開発やメンテナンスに携わっています。
ここ数年の活動の中心は Sphinx です。 Sphinx は Python や Linux カーネルをはじめとして、数多くの OSS のドキュメントに利用されているドキュメンテーションツールです。 Sphinx プロジェクトはごく少人数のメンテナによって活動しており、(明確な役割として定義はされていないものの) リードメンテナ、メインメンテナとして活動しています。
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 datetime import datetime | |
# 7 seconds for every one second in real time | |
TARKOV_RATIO = 7 | |
def real_time_to_tarkov_time(time, left = True): | |
""" | |
Convert real time to Tarkov time | |
:param time: Current UTC epoch in milliseconds -> int(datetime.datetime.utcnow().timestamp()) * 1000 | |
:param left: True if left side, False if right side (Think eft in-game clock) |
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
function interactive (it, env) | |
local has_readline, RL = pcall(require, 'readline') | |
if not has_readline then | |
RL = { | |
readline = function (prompt) | |
io.stdout:write(prompt) | |
return io.read() | |
end | |
} |
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 | |
""" | |
Run a multi-threaded single-client SCPI Server implemented in Python. | |
Using a single-client server is sensible for many SCPI servers | |
where state would need to be shared between the multiple clients | |
and thus access to it would need to be made thread-safe. | |
In most cases, this doesn't make sense. Everything is | |
simply much easier when allowing only one client at a time. |
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 namedtuple | |
from typing import NamedTuple | |
from dataclasses import dataclass, asdict | |
# Python 3.7.3 で検証 | |
D = namedtuple('D', ('a', 'b', 'c')) | |
# 一部のメンバだけデフォルト値指定、というのができない? また、mypyに怒られる(正式な書き方じゃない?)。 | |
D.__new__.__defaults__ = (1, None, 0) |
OlderNewer