Skip to content

Instantly share code, notes, and snippets.

View peace098beat's full-sized avatar

Tomoyuki Nohara peace098beat

View GitHub Profile
"""
元ネタ
https://github.com/arjendeetman/GCMMA-MMA-Python/blob/master/examples/mma_toy2.py
"""
import logging
from dataclasses import dataclass, field
import json
import numpy as np
[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
@peace098beat
peace098beat / Dockerfile
Last active May 13, 2022 13:05
[sktime]
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 September 10, 2021 08:04
[ASCII] #python #ascii
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 February 1, 2022 06:05
[html-build] #matplotlib #python
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 July 24, 2021 14:32
[Google Colab] #colab #python
# 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
@peace098beat
peace098beat / M1.py
Last active October 2, 2021 06:19
[env setup] snippets #python #setup #pipenv #env
# M1
# pyenv
# (* brewはuser homeにインストールしてください)
brew install pyenv
# pipenv
pip3 install --user pipenv
pipenv --python 3
@peace098beat
peace098beat / python
Created May 18, 2019 00:10
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()
@peace098beat
peace098beat / webgl.sample2.js
Created November 18, 2018 04:03
WebGLの基本[2]
<!DOCTYPE html>
<html>
<body>
<style type="text/css">
body {
border: 1;
background-color: gray;
}