Skip to content

Instantly share code, notes, and snippets.

View yui0's full-sized avatar

Yuichiro Nakada yui0

View GitHub Profile
# -*- coding:utf-8 -*-
# ©2024 Yuichiro Nakada
#
# crontab -e
# 0 7,16 * * * python3 ~/weather_line.py
#
# 絵文字: http://www.shurey.com/memo/emoji.html
from dotenv import load_dotenv
load_dotenv()
@yui0
yui0 / api.py
Created August 18, 2022 05:15
template for python api
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys, json
result_json = {'key': 'value'}
print('Content-Type:application/json\n\n')
print(json.dumps(result_json))
@yui0
yui0 / make_report.py
Last active April 20, 2022 02:25
PDF for python
#! /usr/bin/python
# -*- coding: utf-8 -*-
# python3 make_report.py Relatorio.csv 3
# pip install pymupdf
import fitz
import os
import glob
@yui0
yui0 / rembg.ipynb
Created November 2, 2021 06:00
rembg.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import argparse
parser = argparse.ArgumentParser(description='指定された言語の文を抽出します。')
parser.add_argument('name', help='file name')
parser.add_argument('-l', '--lang', help='select language [ja/en/pt]', default='en')
args = parser.parse_args()
import re
#p = r'\~[^~]*\~' # ~で囲まれている~以外の文字
#p = r'\~.+\~' # ~で囲まれている
@yui0
yui0 / sum.comp
Last active April 27, 2021 07:11
GPGPU for vulkan
#version 450
layout (
local_size_x = WORKGROUP_SIZE,
local_size_y = 1,
local_size_z = 1
) in;
layout (binding = 0) buffer buf_in { int buffer_in[]; };
layout (binding = 1) buffer buf_out { int buffer_out[]; };
@yui0
yui0 / gpgpu_gl.c
Last active December 16, 2020 09:40
gpgpu_gl.c
//---------------------------------------------------------
// Cat's eye
//
// ©2020 Yuichiro Nakada
//---------------------------------------------------------
// clang -Os gpgpu_gl.c -o gpgpu_gl `pkg-config --libs --cflags gl egl gbm` -lglfw
// clang -Os gpgpu_gl.c -o gpgpu_gl `pkg-config --libs --cflags glesv2 egl gbm` -lglfw
// dnf install mesa-libgbm-devel libdrm-devel mesa-libGL-devel mesa-libGLU-devel mesa-libEGL-devel mesa-libGLES-devel glfw-
@yui0
yui0 / config.txt
Last active December 2, 2020 12:39
# IPoE
# WAN
description lan1 WAN
ngn type lan1 ntt
ipv6 route default gateway dhcp lan1
#ipv6 prefix 1 ra-prefix@lan1::/64
ipv6 prefix 1 dhcp-prefix@lan1::/64
ipv6 lan1 address dhcp
ipv6 lan1 dhcp service client
@yui0
yui0 / config.txt
Last active December 2, 2020 12:41
# IPoE
# WAN
description lan2 WAN
ngn type lan2 ntt
ipv6 route default gateway dhcp lan2
#ipv6 prefix 1 ra-prefix@lan2::/64
ipv6 prefix 1 dhcp-prefix@lan2::/64
ipv6 lan2 address dhcp
ipv6 lan2 dhcp service client
#!/bin/sh
i=1
#for f in $(ls -1 *.jpg | sort -t'-' -k2h)
ls -1v *.jpg | while read f
do
mv "$f" $(printf "%04d.jpg" $i)
: $((i++))
done