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 / 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"};
@Shinichi-Ohki
Shinichi-Ohki / readme.md
Last active June 15, 2024 02:12
テカナリエレポートをまとめるスクリプト(要pdftk)

テカナリエレポートをまとめるスクリプトです

  • tlsr.rb 番号 でその号のテカナリエレポートをくっつけます。 (例: ruby tlsr.rb 450)
  • 番号は複数指定できます。 (例: ruby tlsr.rb 450 451)
  • -d でディレクトリを指定できます。省略するとカレントディレクトリになります。 (例: ruby tlsr.rb -d treport 450 451)
  • -o で出力ディレクトリを指定できます。省略すると-dで指定したディレクトリになります。 (例: ruby tlsr.rb -d treport -o output 450 451)
  • 2ページ目の画像をJPEGで出力します。出力先は上記出力ディレクトリです。-pでページ数を指定できます
  • -npで画像の出力を抑止します。-pオプションより強いです。
  • pdftkが必要です。 https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
  • macOS版は https://qiita.com/keitasumiya/items/83756caf2865291707fb を参照してください
@Shinichi-Ohki
Shinichi-Ohki / tsp_notice.rb
Created August 2, 2020 05:29
TSP(Task Spooler)のキューに積まれたタスクが全部終わったらPush Bulletで通知を飛ばすRuby Script
#!/usr/bin/env ruby
require 'pushbullet_ruby'
client = PushbulletRuby::Client.new("***pushbullet Access Token***")
tsstr = `tsp`
count=[0,0,0] # running | queued | finished
@Shinichi-Ohki
Shinichi-Ohki / qdate.rb
Last active July 26, 2020 14:08
QooCam output JPEG file Date/Time adjuster
#!/usr/bin/env ruby
require 'optparse'
require 'mini_exiftool'
option_hash = {}
OptionParser.new{|opt|
opt.on('-i','--input JpegFilename' 'string JpegFilename') {|v| option_hash[:orgpathname] = v}
opt.parse!(ARGV)
}
@Shinichi-Ohki
Shinichi-Ohki / headphone_hook_rev2.scad
Created May 24, 2020 04:36
ヘッドフォンフック Openscad
w = 25;
$fn=32;
module kadomaru(w,dir) {
rotate(dir*90) {
intersection() {
translate([2,0,0]) {
cylinder(h=w,r=2);
}
cube([2,2,w]);