Skip to content

Instantly share code, notes, and snippets.

@inajob
inajob / gist:3668ccad9c8f82d0f47102bdf70bcf7b
Last active April 4, 2026 15:16
print image for Atom Printer
# Copyright 2026 inajob
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
byte firstTouches[10];
bool state[20];
uint32_t countOn[20];
uint32_t countOff[20];
void setup(void) {
Serial.begin(115200);
firstTouches[0] = touchRead(T0);
firstTouches[1] = touchRead(T2);
firstTouches[2] = touchRead(T3);
/*
* 2023-12-28 inajob
* Copyright (c) 2023 inajob
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
This is based on https://github.com/cnlohr/ch32v003fun/tree/master/examples/i2c_oled
*/
// what type of OLED - uncomment just one
# https://github.com/takker99/scrapbox-backups の /villagepump で実行する前提です
import json
import sys
import os
import re
iconPattern = r"\[[^\[\]]*\.icon\]"
if len(sys.argv) != 2:
print("usage: " + sys.argv[0] + " userid")
sys.exit()
@inajob
inajob / toICN.js
Last active August 30, 2021 12:13
ChordWikiの和音をICNに変換するブックマークレット).js
javascript:(Array.prototype.slice.bind(document.getElementsByClassName("chord"))().forEach((e)=>{let%20raw=""+e.firstChild.nodeValue;let%20m=raw.match(/^([A-G]m{0,1})([^/]*)/);let%20s="-";if(m){let%20base=m[1];let%20q=m[2];let%20swapped=false;let%20noMap={"C":1,"D":2,"E":3,"F":4,"G":5,"A":6,"B":7};let%20no=noMap[base[0]];let%20isQAvailable=false;if("C,Dm,Em,F,G,Am,Bm".split(",").includes(base)){};if("Cm,D,E,Fm,Gm,A,B".split(",").includes(base)){swapped=true;};if("dim,7,9,M7,sus4,aug".split(",").includes(q)){isQAvailable=true;};s=no+(swapped?"~":"")+(isQAvailable?("["+q+"]"):"");};e.firstChild.nodeValue=s;}));

K66用のファームウェアのビルド方法

リポジトリのclone

$ git clone git@github.com:toastdb/qmk_firmware.git -b womier_k66 --recurse-submodules -j8

docker imageのビルド

@inajob
inajob / qmk-for-k66-in-docker.md
Last active June 15, 2021 12:54
QMK for Womier K66 build in docker

Finally, I built QMK for my K66 in docker.

The instruction is below.

clone repository

$ git clone git@github.com:smp4488/qmk_firmware.git -b womier-k66-rgb-support --recurse-submodules -j8
@inajob
inajob / log.md
Last active June 8, 2021 12:02
QMK for K66 build log (this QMK firmware something wrong)

Warning! the firmware follow this instruction is something wrong! If you want to get proper firmware, don't follow below.

environment

  • Windows 10
  • docker

I use docker due to keep clean my windows environment.

Reference

@inajob
inajob / Mustoolの画面付き顕微鏡のクーポン.md
Created January 29, 2021 04:35
MUSTOOL社の画面付き顕微鏡のスペック表とクーポン一覧(2021/02/28まで)

レビュー記事執筆前ですが、クーポンを先に紹介します。

レビューは下記ブログに掲載予定です。 https://inajob.github.io/iroiro-review/

調べてみるとMUSTOOLの画面付き顕微鏡には様々な種類がありました。 型番もたくさんあるのですが、同じ型番でも微妙に仕様が違うものなどもあり、一応自分なりにまとめてみました。

(このまとめは各ページの情報を転記しただけで、各機能を保証するものではないです。)

@inajob
inajob / main.lua
Created October 21, 2018 07:40
o-bako用ドット絵エディタ
function cls()
color(0,0,0)
fillrect(0,0,128,128)
end
function setup()
cls()
end
digit = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,