Skip to content

Instantly share code, notes, and snippets.

@deton
deton / ame.coffee
Last active September 1, 2019 11:09
A hubot script that notifies rain using YOLP API
# Description
# A hubot script that notifies rain
#
# Configuration:
# HUBOT_AME_LONGLAT
# HUBOT_AME_YOLP_APPID
# HUBOT_AME_HTTPPROXY
# HUBOT_AME_ROOM
#
# Commands:
@deton
deton / bbtrackball.ino
Last active March 19, 2017 02:12
Use "SparkFun Blackberry Trackballer Breakout" as trackball for ATmega32U4
// SparkFun Blackberry Trackballer Breakout
// https://www.switch-science.com/catalog/2276/
#define DEBUG 0
#define Lft 3
#define Rht 2
#define Up 0
#define Dwn 1
@deton
deton / key2pin
Created March 19, 2017 06:03
改造版ミニキーボードのキーマトリックス配線情報
esc P22 P17
1 P22 P23
2 P16 P23
3 P18 P23
4 P15 P23
5 P15 P20
6 P19 P20
7 P19 P23
8 P12 P23
9 P14 P23
@deton
deton / .uim
Created April 8, 2017 02:29
uim-tutcodeで後置型かな漢字変換(連続するひらがなを対象に最長一致)
(define uim-pref-suppress-dot-uim-warning-dialog? #t)
(require "tutcode.scm")
;;; 後置型かな漢字変換を開始する
;;; cf. tutcode-begin-postfix-mazegaki-conversion
(define (tutcode-postfix-kana2kanji-conversion state pc)
(tutcode-context-set-mazegaki-yomi-len-specified! pc 0)
(let*
((former-seq (tutcode-postfix-katakana-acquire-yomi pc #f)) ; 連続するかな
(former-len (length former-seq)))
(and
@deton
deton / usbaltkey.ino
Created April 23, 2017 10:38
USB Alt key
// alt key
// cf. http://qiita.com/MergeCells/items/17bdc1c1fb35949195b5
#define Btn1 2
void setup() {
pinMode(Btn1, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
@deton
deton / index.html
Last active January 3, 2018 01:59
cordova-plugin-geofence crashes on invalid parameters
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<title>geofence test</title>
</head>
<body>
<!-- FIXME: cannot specify valid 0 as latitude, longitude -->
<input type="button" onclick="addGeofence(91, 1, 100, 3);" value="latitude:91">
<input type="button" onclick="addGeofence(1, -181, 100, 3);" value="longitude:-181">
@deton
deton / lynx-jis2utf8.patch
Last active November 10, 2018 01:31
display_charset
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index 1f20ee8..5fbea95 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -93,6 +93,11 @@ static void fake_put_character(HTStream *p GCC_UNUSED,
/*the following macros are used for pretty source view. */
#define IS_C(attr) (attr.type == HTMLA_CLASS)
+#if defined(ISO2022JP_TOUTF8) && defined(EXP_JAPANESEUTF8_SUPPORT)
+# define UTF8_TTY_ISO2022JP (me->T.output_utf8)
@deton
deton / vkimeonofftest.cpp
Created October 14, 2020 23:21
VK_IME_ON, VK_IME_OFFをkeybd_event()で送り付ける
// vkimeonofftest.cpp: VK_IME_ON, VK_IME_OFFをkeybd_event()で送付
// Compile: cl.exe vkimeonofftest.cpp user32.lib
//
// based on https://www.inasoft.org/autokeyb/chapter2.html
// キーボードシミュレータ(C++ ネイディブ版)
// Copyright(C) 2006 T.Yabuki
#define WIN32_LEAN_AND_MEAN // Windows ヘッダーから使用されていない部分を除外します。
#include <windows.h>
#include <stdio.h>
@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) {
@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,