Skip to content

Instantly share code, notes, and snippets.

View Shinichi-Ohki's full-sized avatar

Shinichi Ohki Shinichi-Ohki

  • Switch Science / 144Lab
  • Japan
View GitHub Profile
@Shinichi-Ohki
Shinichi-Ohki / fullwidth_test_page.html
Last active July 23, 2025 07:46
ページ内の全角英数字・記号を半角に自動変換
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>全角英数字テストページ</title>
<style>
body {
font-family: 'Hiragino Sans', 'Yu Gothic', sans-serif;
max-width: 800px;
#!/usr/bin/env python3
# This script is a modified version of the one published at https://zenn.dev/wmoto_ai/articles/58e6bcf58d6032
# このスクリプトは https://zenn.dev/wmoto_ai/articles/58e6bcf58d6032 で公開されたものを変更したものです
import sys
import os
import warnings
import logging
import re
@Shinichi-Ohki
Shinichi-Ohki / Readme.md
Last active March 26, 2025 12:19
逆順駅名を探せ

逆順駅名を探せ

「田町」「町田」のように、逆にしても成立する日本の駅名を探します。

  1. 国土数値情報ダウンロードサイト国土数値情報 鉄道データから最新のデータ(現時点ではN02-23_GML.zip)をダウンロードします。
  2. zipファイルを展開してできたフォルダの中のutf-8フォルダの中にjson-to-csv-script.rbとstation-anagram-finder.rbをコピーします。
  3. ruby json-to-csv-script.rb N02-23_Station.geojson を実行します。geojsonファイルの名前は適宜変更してください。
  4. station-anagram-finder.rb を実行します
  5. 逆順駅名のセットとアナグラム駅名のセットが出力されます
@Shinichi-Ohki
Shinichi-Ohki / all_human.svg
Created March 25, 2025 14:56
オールヒューマンマーク by GOROman vectored by Ohki
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Shinichi-Ohki
Shinichi-Ohki / enlarge_docsm5stack.styl
Last active February 15, 2025 06:41
docs.m5stack.comの文字が小さすぎるとお嘆きのあなたに For those of you who lament that the text on docs.m5stack.com is too small
/* ==UserStyle==
@name docs.m5stack.com enlarge font size
@namespace github.com/openstyles/stylus
@version 1.0.0
@description docs.m5stack.comの文字が小さすぎるとお嘆きのあなたに
For those of you who lament that the text on docs.m5stack.com is too small
@author Shinichi Ohki (@ohki)
==/UserStyle== */
@-moz-document url-prefix("http://docs.m5stack.com/"), url-prefix("https://docs.m5stack.switch-science.com/") {
.markdown,
@Shinichi-Ohki
Shinichi-Ohki / todoist_addtask.py
Created December 21, 2024 02:51
Todoistの「買い物リスト」プロジェクトにタスクを追加するスクリプト
import sys
sys.path.append('/opt/homebrew/lib/python3.9/site-packages')
# todoist_api_pythonがPython 3.9までしか動作確認してないからこれ以上新しいのには入らないっぼい
import datetime
from todoist_api_python.api import TodoistAPI
# 今日の日付を文字列に変換(そのままだとJSONに入らないので)
str_today = str(datetime.date.today())
void setup() {
size(640, 400);
color[] c = {#000000,#0000FF,#FF0000,#FF00FF,#00FF00,#00FFFF,#FFFF00,#FFFFFF};
background(c[0]);
strokeWeight(2);
int[] d = new int[160];
for (int i = 1; i < 160; i++) {
d[i] = 100;
@Shinichi-Ohki
Shinichi-Ohki / giteki.svg
Last active May 2, 2022 01:30
技適マークをSVGで書いた
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Shinichi-Ohki
Shinichi-Ohki / vibe_test.ino
Created March 11, 2021 04:11
M5Stack Core2 vibration test sketch.
#include <M5Core2.h>
void vibration(int t) {
M5.Axp.SetLDOEnable(3, true);
delay(t);
M5.Axp.SetLDOEnable(3, false);
}
void setup() {
M5.begin(true, true, true, true);
@Shinichi-Ohki
Shinichi-Ohki / m5paper_rtc_set_ntp.ino
Last active June 19, 2021 15:07
M5Paper RTC set from NTP
#include <M5EPD.h>
#include <WiFi.h>
rtc_time_t RTCtime;
rtc_date_t RTCDate;
char timeStrbuff[64];
static const int JST = 3600 * 9;
static const char *wd[7] = {"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat"};