Skip to content

Instantly share code, notes, and snippets.

@deton
deton / gzip.html
Created October 31, 2023 13:00
gzip on browser
<html>
<head>
<title>gzip on browser</title>
</head>
<body>
<input type="file" id="fileElem" multiple />
<script>
const fileElem = document.getElementById("fileElem");
@deton
deton / 00README.md
Last active August 27, 2023 05:20
aspidaのapiディレクトリ構造とindex.tsをもとに、OpenAPI記述(JSON)を生成するための、簡易的なスクリプト

aspida2openapi

aspidaのapiディレクトリ構造とindex.tsをもとに、 OpenAPI記述(JSON)を生成するための、簡易的なスクリプトです。

ts-json-schema-generatorを使って、index.tsをJSON schemaに変換して、 OpenAPI記述を生成します。

生成物の以下の部分などを、手で変更して使う想定です。

  • ファイルアップロード・ダウンロード関係
@deton
deton / lynx-notoolbarcfg.patch
Created December 31, 2022 03:43
Lynx patch to disable toolbar by lynx.cfg
diff --git a/LYMessages_en.h b/LYMessages_en.h
index 7014be6..ac64f9a 100644
--- a/LYMessages_en.h
+++ b/LYMessages_en.h
@@ -426,6 +426,7 @@
#define NO_EDITOR gettext("No editor is defined!")
#define PRINT_DISABLED gettext("The 'p'rint command is currently disabled.")
#define NO_TOOLBAR gettext("Document has no Toolbar links or Banner.")
+#define TOOLBAR_DISABLED gettext("Toolbar is currently disabled.")
#define CANNOT_OPEN_TRAV_FILE gettext("Unable to open traversal file.")
@deton
deton / lynx-notoolbarifdef.patch
Created December 31, 2022 03:42
Lynx patch to disable toolbar
diff --git a/src/HTML.c b/src/HTML.c
index 660106e..bfb5248 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -1182,6 +1182,7 @@ static int HTML_start_element(HTStructured * me, int element_number,
break;
case HTML_LINK:
+#ifdef USE_TOOLBAR
intern_flag = FALSE;
@deton
deton / faucet-handle-adapter-readme.md
Last active December 5, 2022 11:07
蛇口ハンドルアダプタ3Dプリント用データ

蛇口ハンドルアダプタ3Dプリント用データ

浴室蛇口MS392-005の蛇口ハンドル(KP76DW?)とMYMスピンドル間のアダプタの3Dプリント用データ。

DMM.makeの3Dプリンターサービスで522円(素材:Resin A1 Pro)でした。

  • faucet-handle-adapter.FCStd: FreeCADファイル
  • faucet-handle-adapter.stl: 3Dプリント用STLファイル。FreeCADからエクスポートしたもの。

参考情報

蛇口ハンドルの見た目は、KP76DWっぽいですが、アダプタが付いているかは未確認。

@deton
deton / lynx-headingslist.patch
Last active June 5, 2022 11:14
Lynx patch to add H1-H6 headings link list to List Page
diff --git a/src/GridText.c b/src/GridText.c
index d9a1665..b3c41e0 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -6257,6 +6257,34 @@ HTChildAnchor *HText_childNextNumber(int number, void **prev)
return a->anchor;
}
+#ifdef EXP_HEADINGLIST
+/* returns not only HREF anchor which has number
@deton
deton / lynx-jajoinspaces.patch
Last active March 26, 2022 03:57
lynx patch not to add spaces on joining lines for Japanese
diff --git a/src/GridText.c b/src/GridText.c
index 04e9a4a..d9a1665 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -453,7 +453,11 @@ struct _HText {
HTList *hidden_links; /* Content-less links ... */
int hiddenlinkflag; /* ... and how to treat them */
BOOL no_cache; /* Always refresh? */
+#ifdef EXP_JAPANESE_SPACES
+ char LastChars[7]; /* utf-8 buffer */
@deton
deton / lynx-ppre.patch
Last active May 29, 2022 01:35
lynx patch for <p> style white-space:pre
diff --git a/WWW/Library/Implementation/HTStyle.h b/WWW/Library/Implementation/HTStyle.h
index 79ba003..efaeaed 100644
--- a/WWW/Library/Implementation/HTStyle.h
+++ b/WWW/Library/Implementation/HTStyle.h
@@ -221,6 +221,8 @@ extern "C" {
ST_GlossaryCompact6,
ST_Example,
ST_Preformatted,
+ ST_PreformattedDiv,
+ ST_PreformattedP,
@deton
deton / gm1356.js
Created December 12, 2021 07:14
read decibel value from GM1356 Digital Sound Level Meter
// read decibel value from GM1356 Digital Sound Level Meter
//
// https://github.com/gymnasty/gm1356
// https://github.com/pvachon/gm1356
// https://github.com/dobra-noc/gm1356
// https://github.com/PhilippCo/soundmeter
const HID = require('node-hid');
const device = new HID.HID(0x64bd, 0x74e3);
device.on('data', function (data) {