Skip to content

Instantly share code, notes, and snippets.

View peace098beat's full-sized avatar

Tomoyuki Nohara peace098beat

View GitHub Profile
@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 / 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 / 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 / file0.txt
Last active September 5, 2020 13:38
AWS LightsailでGitlab環境をワンクリックで構築 (2018年11月) ref: https://qiita.com/peace098beat/items/3ac45e15e60fe6fd1b6f
CPU: 2 cores is the recommended number of cores and supports up to 500 users
Memory: 8GB RAM is the recommended memory size for all installations and supports up to 100 users
@peace098beat
peace098beat / fdtd_2d_c_sjis.c
Last active February 8, 2020 13:24
[FDTD] FDTDによる音の可視化 C->pythonにポーティング
// 二次元音響FDTDサンプル for C (by Masahiro TOYODA)
// gnu gcc -> gcc fdtd_2d_c_sjis.c -lm -O3 -fopenmp -o fdtd_2d_c_sjis.exe
// intel c -> icc fdtd_2d_c_sjis.c /O3 /Qopenmp
//■■■ヘッダーの読み込み■■■
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@peace098beat
peace098beat / AtFI.jsx
Created October 22, 2014 05:13
[AE] UI関連スクリプト その1
/*-------------------------------------------------------------------------------------------------------*/
/*
■Name tr_AtFI
■ver0.1 
■20090211 
■Author Matsuda(Expresson) &Terraon(Script&Icon)
□選択レイヤとその”一つ下”のレイヤの重複部分frフェードインを行います。
レイヤーコメントも追加します。また、既に透明度にエクスプレッションが適用されている場合は効果を”リセット”します。
■All Rights @ Free
拙いコードですが引用も転用もご自由に。
/*Complex Selector Example*/
QLineEdit { color: red }
QLineEdit[readOnly="true"] { color: gray }
QDialog QLineEdit { color: brown }
/*Customizing QAbstractScrollArea*/
QTextEdit, QListView {
background-color: white;
background-image: url(draft.png);
background-attachment: scroll; /*If the background-image is to be fixed with the viewport: scroll or fixed*/
}
@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 / file0.txt
Last active May 4, 2019 12:18
[サクラレンタルサーバー] (初心者向け) PythonとpyenvとFlaskの環境構築方法。| cshの場合 ref: https://qiita.com/peace098beat/items/de9fdadfc4128e99bca6
$ cd /home/<username>/
$ cd $HOME
$ cd ~/
$ cd /home/fififactory/