Skip to content

Instantly share code, notes, and snippets.

@nobonobo
nobonobo / main.go
Created June 11, 2024 09:53
TinyGo + MicroBit:v2 で IMUを読む
package main
import (
"fmt"
"machine"
"time"
"tinygo.org/x/drivers/lsm303agr"
)
@nobonobo
nobonobo / cmd.exe
Created February 7, 2024 12:45
wrc-pacenote-mod.exe起動時の様子
>wrc-pacenote-mod.exe
2024/02/07 21:44:29 voicedb.go:77: loading dictionary.json
2024/02/07 21:44:29 voicedb.go:87: dictionary.json loading completed
2024/02/07 21:44:29 main.go:348: udp listening start: 127.0.0.1:20777
2024/02/07 21:44:29 main.go:421: http listening start: 127.0.0.1:8080
2024-02-07T21:44:29.636997+09:00 INFO voicevox_core::voice_synthesizer: 検出されたGPU (DirectMLには1番目のGPUが使われます):
2024-02-07T21:44:29.639189+09:00 INFO voicevox_core::voice_synthesizer: - "NVIDIA GeForce RTX 4060" (7.77 GiB)
2024-02-07T21:44:29.639240+09:00 INFO voicevox_core::voice_synthesizer: - "Microsoft Basic Render Driver" (0 B)
2024/02/07 21:44:30 ttsengine.go:136: TTS Engine started
@nobonobo
nobonobo / readme.md
Last active April 21, 2023 05:50
opencv-contrib-pythonの配布バイナリの生成

prerequire

dockerのクロスアーキテクチャサポートを有効にする WSL2の場合、「sudo apt install qemu-user-static」とするだけ。

docker run --rm -it arm64v8/alpine:latest

setup

@nobonobo
nobonobo / gist:19f6303997669cf8271b9d6e04ea4f76
Last active April 20, 2023 00:31
DIYハンコントラブルシュート
DIYハンコンが
クリーンインストールWin11環境で認識がおかしい。
package main
import (
"fmt"
"machine"
"machine/usb/midi"
"time"
)
// Try it easily by opening the following site in Chrome.
{
init: (elevators, floors) => {
floors.time = 0;
floors.waiting = new Array(floors.length).fill(0);
floors.forEach((floor, n) => {
let floorNum = n
floors[floorNum].on("down_button_pressed", () => {
floors.waiting[floorNum]++;
});
floors[floorNum].on("up_button_pressed", () => {
@nobonobo
nobonobo / caption.js
Created March 24, 2022 11:46
macOSのsipsコマンドで画像に文字を入れる
console.log(sips.arguments);
const caption1 = sips.arguments[3];
const caption2 = sips.arguments[4];
const w = sips.images[0].properties.PixelWidth;
const h = sips.images[0].properties.PixelHeight;
const canvas = new Canvas(w, h);
canvas.drawImage(sips.images[0], 0, 0);
canvas.font = "96pt Futura";
canvas.textAlign = "left";
canvas.textBaseline = "middle";
@nobonobo
nobonobo / sample.go
Created September 11, 2021 19:44
TinyGo + PineTime64 サンプルを https://play.tinygo.org/ で試す
package main
import (
"image/color"
"time"
"machine"
"tinygo.org/x/drivers/st7789"
)
@nobonobo
nobonobo / build.sh
Created July 9, 2021 03:43
コンパイル日時をバイナリに埋める方法
> go build -ldflags "-X main.Build=$(date +%Y-%m-%dT%H:%M:%S)" sample.go
> ./sample.go
2021-07-09T12:41:11
@nobonobo
nobonobo / gzip_test.go
Last active June 13, 2021 23:23
GZIPの作成速度C版とGo標準との比較
package main
import (
"compress/gzip"
"io"
"os"
"testing"
"github.com/mistsys/cgzip"
)