Skip to content

Instantly share code, notes, and snippets.

View t-nissie's full-sized avatar

Takeshi Nishimatsu t-nissie

View GitHub Profile
/* WebAssembly/WASM/Emscripten Arguments.c can get three arguments from URL parameters */
/* For example: http://localhost:6931/arguments.html?foo=Hello%2c&bar=Takeshi%20Nishimatsu&baz=Everything%20is%20OK%3f */
/* See also JavaScript between </script><script> in template.html. */
/* Import canvas.c and canvas.h from https://github.com/alextyner/wasm-canvas */
#include "canvas.h"
int main(int argc, char** argv) {
HTMLCanvasElement *canvas = createCanvas("myCanvas");
canvas->setWidth( canvas, 600);
canvas->setHeight(canvas, 400);
CanvasRenderingContext2D *ctx = canvas->getContext(canvas, "2d");
@t-nissie
t-nissie / !HowToGist.md
Last active April 8, 2026 08:52
Gistの使い方のメモ

Gistの使い方のメモ

Gistを使い始めて気がついた点をメモした。 Gistはこのようなメモや短いコードをバージョン管理しながら公開するのに便利。

特にこのメモでは、画像を同一ディレクトリに置いて、 それGFMファイル内に挿入する方法を解説。

このメモにはgitコマンドの使い方の解説はない。 このメモは随時更新される予定。

@t-nissie
t-nissie / Animation.c
Last active March 23, 2026 13:29
animation with wasm-canvas
// Animation.c
// wasm-canvas: https://github.com/alextyner/wasm-canvas
// How to compile and run locally (as written in Makefile):
// ln -s SOMEWHERE/wasm-canvas/src/canvas.c .
// ln -s SOMEWHERE/wasm-canvas/src/canvas.h .
// emcc -c -o animation.o animation.c
// emcc -c -o canvas.o canvas.c
// emcc --shell-file template.html animation.o canvas.o -o index.html
// emrun index.html
////
@t-nissie
t-nissie / ArcWASM.c
Last active March 22, 2026 07:06
Draw an arc with wasm-canvas
// ArcWASM.c draws a rectangle and an arc with wasm-canvas as same as original.html
// wasm-canvas: https://github.com/alextyner/wasm-canvas
// How to compile and run locally (as written in Makefile):
// ln -s SOMEWHERE/wasm-canvas/src/canvas.c .
// ln -s SOMEWHERE/wasm-canvas/src/canvas.h .
// emcc -c -o ArcWASM.o ArcWASM.c
// emcc -c -o canvas.o canvas.c
// emcc --shell-file template.html ArcWASM.o canvas.o -o index.html
// emrun index.html
////
@t-nissie
t-nissie / !Mercari.md
Last active January 24, 2026 07:17
メルカリの暗号資産(ビットコイン、イーサリアム、XRP)の月間取引報告書CSVファイルから確定申告のために年中購入または年中売却の数量と金額を計算するRubyスクリプト(とそれをCrystalで書き直したもの)

mercari.rb and mercari.cr

メルカリの暗号資産(ビットコインBTC、イーサリアムETH、XRP)の月間取引報告書CSVファイルから 確定申告のために年間の損益計算をするためのRubyスクリプトmercari.rbと それをCrystal言語に移植したmercari.cr

ライセンスは GPLv3 で、完全無保証です。税務署に怒られてもしりません。

参考文献: https://help.jp.mercari.com/guide/articles/1513/ メルカル ビットコイン取引 取引報告書・損益計算方法

@t-nissie
t-nissie / 00FujitsuArrowsTabQ508Ubuntu22.04LTS.md
Last active December 13, 2025 12:30
FUJITSU ARROWS Tab Q508/SEにUbuntu 22.04 LTS 日本語 RemixをインストールしてAnet ET4+をKlipperで制御

FUJITSU ARROWS Tab Q508/SEにUbuntu 22.04 LTS 日本語 Remixをインストールして3DプリンターをKlipperで制御

Atom x7-Z8700 1.6GHz/RAM:4GB/SSD:128GB/10.1インチなタブレットPC FUJITSU ARROWS Tab Q508/SE に Ubuntu 22.04 LTS 日本語 Remix という GNU/Linux をインストールして Klipper, Moonraker, Mainsailをインストールして 3DプリンターAnet ET4+を制御した記録。 2024年9月に 24.04 LTS でも動くことを確認したので、更新。 完全無保証

@t-nissie
t-nissie / osiad_white_printer.cfg
Last active December 6, 2025 06:00
printer.cfg for ET4000+ and CoreXY
# CoreXY printer.cfg for EasyThreeD ET4000+ board
# I use ET4000+ main board for my CoreXY printer project.
# ET4000+ is MKS Robin Lite compatible.
# Motor ampere can be controlled via pwm pins: PB0, PA7 and PA6.
# Original file is https://github.com/makerbase-mks/Klipper-for-MKS-Boards/blob/main/MKS%20Robin%20Lite%20V1.1/generic-mks-robin-lite-v1.cfg
# The firmware binary is also in the same GitHub directory.
# To use this config, the firmware should be compiled for the
# STM32F103RCT6. When running "make menuconfig", enable "extra low-level
# configuration setup", select the 28KiB bootloader, and serial (on
@t-nissie
t-nissie / !mruby.md
Last active September 15, 2025 08:22
mrubyをC言語のシミュレーションのプログラムに組み込んでDSLとして利用する

mrubyをC言語のシミュレーションのプログラムに組み込んでDSLとして利用する

シミュレーション、CAD、画像処理、ゲーム、エディタなどのアプリで Tcl, Scheme, Lua, Python, LISPなどが domain-specific language (DSL) として採用されていて、 パラメーターサーチ、 繰り返し処理、

@t-nissie
t-nissie / 00EasythreedX3Klipper.md
Last active August 30, 2025 10:16
3DプリンターEasythreed X3にクリッパーをインストールした記録

3DプリンターEasythreed X3にKlipperをインストールした記録

3DプリンターEasyThreed X3の中古品にKlipperをインストールした記録。 X3のマザーボードのET4000+はRobin Liteの互換品と思われる。

この文章のオリジナルは https://gist.github.com/t-nissie/016d3d4c93b91c6c666c38aa6cf560d1 にある。

Klipper, Moonraker, Mainsailの詳細については解説していない。 それらについては https://gist.github.com/t-nissie/9256acaf29cc901fa1504d7ace79a2e3 が参考になるかもしれない。

@t-nissie
t-nissie / 00USBtiny.md
Last active August 30, 2025 09:26
Write a program on AVR with USBtiny and a 6-pin cable from Linux

Write a program on AVR with USBtiny and a 6-pin cable from Linux

USBtiny or "USB Tiny ISP" is a writer/reader for in-system programming (ISP) or in-circuit serial programming (ICSP) for AVR. Although there is no drivers for Windows 10 nor 11, we can still use USBtiny with Linux.

USBtiny My USB Tiny ISP. It was around 10 USD.