This file contains hidden or 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) |
This file contains hidden or 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
$word = NEW-OBJECT -COMOBJECT WORD.APPLICATION | |
Write-Host "[フォルダ内のdocxからpdfを生成します]" | |
$files = Get-ChildItem | Where-Object{$_.Name -match "docx$"} | |
Write-Host "[変換開始]" | |
foreach($file in $files) | |
{ | |
try | |
{ | |
$result = (Test-Path $file.FullName.Replace(".docx",".pdf")) |
This file contains hidden or 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 hidden or 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 | |
} |
OlderNewer