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 / 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]);
@Shinichi-Ohki
Shinichi-Ohki / CSIA会員リスト.csv
Created May 21, 2020 12:54
CSIA 中国半导体行业协会 の会員リスト(社名とURL)をまとめました http://www.csia.net.cn/Index.asp
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2 in line 1.
- CSIA现有会员名录:集成电路类
中国电子科技集团公司第四十七研究所,www.dz47.com
北京首钢微电子有限公司,http://www.bsmc.com.cn/
西安微电子技术研究所(中国航天科技集团公司第九研究院第七七一研究所),www.
哈尔滨海格科技发展有限责任公司,www.hegtech.com
北京伊泰克电子有限公司,www.estek.com.cn
华润微电子有限公司,www.crmicro.com
北京大学信息科学技术学院微电子学研究院,www.ime.pku.edu.cn
英飞凌科技(中国)有限公司,www.infineon.com/cn
上海华虹宏力半导体制造有限公司,www.hhgrace.com
@Shinichi-Ohki
Shinichi-Ohki / base_convert_for_alfred4.rb
Last active February 26, 2020 14:17
base converter workflow for Alfred 4
def output_16(q16)
output = <<"EOS"
{ "title": "#{q16}",
"arg": "#{q16}",
},
{ "title": "0x#{q16}",
"arg": "0x#{q16}",
}
EOS
output
@Shinichi-Ohki
Shinichi-Ohki / suiryushi.ahk
Last active August 11, 2019 09:14
水龍士I 復刻版をノートPCでやるためのキー入れ替え(AutoHotKey)
#InstallKeybdHook
#UseHook
u::4
i::5
o::6
j::1
k::2
l::3
p::*
+u::u
@Shinichi-Ohki
Shinichi-Ohki / boot.py
Last active February 5, 2022 07:35
M5StickVのバッテリ電圧と放電電流を取得
import lcd
import utime
import sys
from machine import I2C
from Maix import GPIO
from fpioa_manager import *
i2c = I2C(I2C.I2C0, freq=400000, scl=28, sda=29)
# And a short delay to wait until the I2C port has finished activating.
utime.sleep_ms(100)
@Shinichi-Ohki
Shinichi-Ohki / m5stickv_backlight.py
Created July 19, 2019 18:44
M5stickVのバックライトを制御する
import lcd #for test
from machine import I2C
i2c = I2C(I2C.I2C0, freq=400000, scl=28, sda=29)
lcd.init() #for test
lcd.draw_string(100, 100, "hello maixpy", lcd.RED, lcd.BLACK) #for test
i2c.writeto_mem(0x34, 0x91,b'\x70') # minimum
i2c.writeto_mem(0x34, 0x91,b'\xf0') # maximum
@Shinichi-Ohki
Shinichi-Ohki / todoist-modify-date-priorty.py
Last active July 10, 2019 08:41
Todoistの特定のプロジェクト(Inbox)にあるタスクの締め切りを今日に、優先度を最高に変更する
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function,
absolute_import, unicode_literals)
from pytodoist import todoist
API_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
def main():
# Original https://github.com/sipeed/MaixPy_scripts/blob/master/machine_vision/demo_find_face.py
# for MAiX BiT
import sensor
import image
import lcd
import time
import KPU as kpu
clock = time.clock()
@Shinichi-Ohki
Shinichi-Ohki / m5stickc_setrtc_fromntp.ino
Created April 25, 2019 16:45
Set RTC from NTP for M5StickC on Arduino IDE
#include <M5StickC.h>
#include <WiFi.h>
#include <time.h>
RTC_TimeTypeDef RTC_TimeStruct;
RTC_DateTypeDef RTC_DateStruct;
static const int JST = 3600 * 9;
static const char *wd[7] = {"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat"};