Skip to content

Instantly share code, notes, and snippets.

Avatar

Tomoyuki Nohara peace098beat

View GitHub Profile
View cron_with_docker.txt
[dockerコマンドをcronで実行させたら「TTYが無いよ」と怒られた件 | Hodalog](https://hodalog.com/how-to-resolve-the-error-that-the-input-device-is-not-a-tty/)
- docker-compose
- [cron駆動のdocker(docker-compose) execが走らない問題の対応 - Qiita](https://qiita.com/chankame/items/a939c8653e0e4845fc8a)
- docker-compose exec -T app date
View Dockerfile
FROM python:3.8-buster as builder
RUN pip3 install --upgrade pip
RUN pip3 install sktime==0.11.0
FROM python:3.8-slim-buster as runner
COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
RUN apt-get update \
@peace098beat
peace098beat / ascii.py
Created Sep 10, 2021
[ASCII] #python #ascii
View ascii.py
import cv2
density = list("MWN$@%#&B89EGA6mK5HRkbYT43V0JL7gpaseyxznocv?jIftr1li*=-~^`':;,. ")
LEN = len(density)
def image_print(image, wid=30):
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
resized = cv2.resize(gray, (int(wid*2),int(wid)))
for i in range(resized.shape[0]):
s = ""
@peace098beat
peace098beat / build_html.py
Last active Feb 1, 2022
[html-build] #matplotlib #python
View build_html.py
import os
import argparse
import glob
def build_html(paths, w=500):
html = """<style>
.d {
width: 500px;
float:left;
@peace098beat
peace098beat / spec.py
Last active Jul 24, 2021
[Google Colab] #colab #python
View spec.py
# Scrach Pad
# https://colab.research.google.com/notebooks/empty.ipynb
# KaggleOps
# [KaggleOpsを考える ~ MLflow + Colaboratory + Kaggle Notebook ~ | GMOインターネットグループ 次世代システム研究室](https://recruit.gmo.jp/engineer/jisedai/blog/kaggleops-mlflow/)
# GPU
# NVIDIA GPUスペック(機械学習用)https://qiita.com/yukoba/items/10d0ba3fb1d19a6ab6a5
!nvidia-smi
View setup-tabnine.sh
pip3 install jupyter-tabnine --user
jupyter nbextension install --py jupyter_tabnine --user
jupyter nbextension enable --py jupyter_tabnine --user
jupyter serverextension enable --py jupyter_tabnine --user
# for pipenv
pipenv install --dev jupyter-tabnine --user
pipenv run jupyter nbextension install --py jupyter_tabnine --user
pipenv run jupyter nbextension enable --py jupyter_tabnine --user
@peace098beat
peace098beat / M1.py
Last active Oct 2, 2021
[env setup] snippets #python #setup #pipenv #env
View M1.py
# M1
# pyenv
# (* brewはuser homeにインストールしてください)
brew install pyenv
# pipenv
pip3 install --user pipenv
pipenv --python 3
@peace098beat
peace098beat / python
Created May 18, 2019
Pythonのヴァージョン確認
View python
import sys
# Check Python Version
if sys.version_info.major < 3:
sys.stderr.write('Please use python 3.x\n')
sys.stderr.write(
'Your python version is as following:{}\n'.format(sys.version))
exit()
View webgl.sample2.js
<!DOCTYPE html>
<html>
<body>
<style type="text/css">
body {
border: 1;
background-color: gray;
}