progress
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 os | |
import sys | |
from glob import glob | |
from importlib import import_module | |
sys.path.append('plugins') | |
for path in glob('plugins/*.py'): | |
filename = os.path.basename(path) | |
print(filename) |
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
mkdir -p mnt | |
sshfs host:/path/to/dir mnt | |
fusermount -u mnt |
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 heapq | |
import os | |
import re | |
from argparse import ArgumentParser | |
from contextlib import contextmanager | |
from operator import itemgetter | |
from tempfile import TemporaryDirectory, mktemp | |
import sys | |
from typing import IO, Callable, List |
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 time | |
from concurrent.futures import ThreadPoolExecutor | |
from logging import StreamHandler, Formatter, INFO, getLogger | |
def init_logger(): | |
handler = StreamHandler() | |
handler.setLevel(INFO) | |
handler.setFormatter(Formatter("[%(asctime)s] [%(threadName)s] %(message)s")) | |
logger = getLogger() |
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
#https://github.com/neologd/mecab-ipadic-neologd/blob/master/README.ja.md | |
FROM ubuntu | |
RUN apt update | |
RUN apt -y upgrade | |
RUN apt -y install mecab libmecab-dev mecab-ipadic-utf8 git make curl xz-utils file | |
# install neologd | |
RUN mkdir -p /usr/lib/mecab/dic | |
RUN cd /root; \ |
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
command: ["./wait-for-db.sh", "--", "python", "manage.py", "runserver", "0.0.0.0:8000"] |
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 re | |
import requests | |
import time | |
def main(): | |
url = "http://qiita.com/sudoyu/items/0a51593b257f419aeb20.md" | |
print(url) |
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
urlpatterns = [ | |
url(r"^mysite/", include([ | |
url(r"^accounts/", include([ | |
url(r"^login/$", auth_views.login, {"template_name": "accounts/login.html"}, name="login"), | |
url(r"^logout/$", auth_views.logout, name="logout"), | |
], namespace="accounts", app_name="accounts")), | |
url(r'^admin/', admin.site.urls), | |
url(r'^', include('app.urls')), | |
])) |
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 PIL import Image | |
img = Image.open("test.png") | |
if img.mode == 'RGBA' or "transparency" in img.info: | |
print("透過画像") |