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
import string | |
LOWER = "ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮ" | |
UPPER = "あいうえおつやゆよわアイウエオツヤユヨワ" | |
MAP = str.maketrans(dict(zip(LOWER, UPPER))) | |
def ja_upper(text: str) -> str: | |
return text.translate(MAP) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 pathlib import Path | |
import os | |
import re | |
import subprocess | |
import fire | |
import requests | |
ENDPOINT = "https://api.github.com" | |
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
curl -H "Authorization: token $GITHUB_TOKEN" \ | |
-H "Content-Type: $(file -b --mime-type $FILE)" \ | |
--data-binary @$FILE \ | |
"https://uploads.github.com/repos/$REPO/releases/$RELEASE/assets?name=$(basename $FILE)" |
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
#!/bin/bash | |
SLACK_NOTIFY_ICON=":ghost:" | |
if [ ! -f ~/.notify-slack-cfg ]; then | |
echo "ERROR: A Webhook URL is required. Create yours here: https://my.slack.com/services/new/incoming-webhook/" | |
echo "Once you have your KEY, please create a file at ${HOME}/.notify-slack-cfg containng only the KEY. Eg: T02TKKSAX/B246MJ6HX/WXt2BWPfNhSKxdoFNFblczW9" | |
return | |
fi | |
SLACK_MESSAGE="$1" |
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
[tool.poetry] | |
name = "foo" | |
version = "0.1.0" | |
description = "" | |
authors = ["Your Name <[email protected]>"] | |
[tool.poetry.dependencies] | |
python = "^3.7" | |
[tool.poetry.dev-dependencies] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
class UnionFind: | |
def __init__(self, objects): | |
self.objects = list(objects) | |
self.weights = {i: 1 for i in range(len(self.objects))} | |
self.parents = list(range(len(self.objects))) | |
self.obj2num = {k: i for i, k in enumerate(self.objects)} | |
def add(self, obj): | |
self.objects.append(obj) | |
n = len(self.objects)-1 |
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
import qualified Data.Vector.Unboxed as U | |
import Data.Vector.Unboxed ( (!) ) | |
import qualified Data.Vector.Unboxed.Mutable as UM | |
import Control.Monad.ST | |
import Control.Monad | |
base = 10 ^ 9 + 7 :: Int | |
maxL = 3 * 10 ^ 5 :: Int | |
n *% m = (n * m) `mod` base |
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
[metadata] | |
name = {} | |
home-page = {} | |
long-description = file: README.md | |
[options] | |
zip_safe = false | |
include_package_data = true | |
python_requires = >=3.6 | |
packages = {} |