Skip to content

Instantly share code, notes, and snippets.

@hanya
hanya / CustomNodeSelector.gd
Last active September 19, 2023 09:54
Example Editor Inspector plugin for Godot
extends EditorInspectorPlugin
var NodeSelector = preload("res://addons/custom_node_selector/NodeSelector.gd")
var Selector = preload("res://addons/custom_node_selector/Selector.gd")
func can_handle(object):
# only ItemMenu / SomeButton buttons are handled
if object.get_class() == "Button":
var parent = object.get_parent()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title id="document-title">○さいたまメーカー</title>
<link rel="icon" type="image/png" href="./assets/img/favicon.png">
<style>
.row {
line-height: 140%;
@hanya
hanya / prk_keycode.md
Created December 10, 2021 08:38
List of keycodes for prk_firmware
Key Alias Description
:KC_NO :XXXXXXX
:KC_ROLL_OVER
:KC_POST_FAIL
:KC_UNDEFINED
:KC_A a and A
:KC_B b and B
:KC_C c and C
@hanya
hanya / bits.gdbinit
Created September 11, 2021 01:19
GDB script to show bits from address
python
def _bits_extend(value, max, min):
vs = []
vs.append("")
for i in range(min, max + 1)[::-1]:
if (value & (1 << i)) > 0:
vs.append(" 1")
else:
vs.append(" 0")
<!DOCTYPE html>
<html><head><meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Bit display</title>
<style type="text/css">
div#input2, div#input3, div#input4 {
margin-top: 1em;
}
table {
@hanya
hanya / mozc.patch
Created August 6, 2021 01:06
Patch file for mozc
diff --git a/src/third_party/abseil-cpp/absl/base/config.h b/src/third_party/abseil-cpp/absl/base/config.h
index 9544996..f878679 100644
--- a/src/third_party/abseil-cpp/absl/base/config.h 2021-08-05 16:07:34.771751936 +0900
+++ b/src/third_party/abseil-cpp/absl/base/config.h 2021-08-05 14:02:43.693370880 +0900
@@ -375 +375 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
- defined(__ASYLO__) || defined(__myriad2__)
+ defined(__ASYLO__) || defined(__myriad2__) || defined(__HAIKU__)
@hanya
hanya / pack.sh
Created August 6, 2021 00:23
Packing mozc files
packVersion=v2.23.2785.102.4
#git clone -b haiku --recursive --depth=1 https://github.com/hanya/mozc.git
#git submodule clone --init --recursive
#cd mozc
#git pull
cd ..
#tar -cJf mozc-$packVersion.tar.xz
tar -cjf mozc-$packVersion.tar.bz2 \
@hanya
hanya / mozc_ut-2.23.2785.102.9.recipe
Last active August 4, 2021 00:01
Mozc with UT dictionary for Haiku
SUMMARY="Japanese input method editor"
DESCRIPTION="A Japanese Input Method Editor (IME) designed for multi-platform. \
This is open source version.
With Mozc UT dictionary which adds over 1,000,000 entries to original dictionary."
HOMEPAGE="https://github.com/google/mozc"
COPYRIGHT="2010-2018 Google Inc.
2017-2019 Hirosi Utumi
2019 Japan post
2009-2011 NICT
2021 Wikipedia"
@hanya
hanya / sym2lib.py
Last active December 22, 2020 13:10
Converts kicad_sym file into old lib file for stroke font used by KiCAD.
# Converts kicad_sym file into old lib file for stroke font.
# This converter supports only fixed width glyph such as
# Chinese characters, hiragana and katakana.
import sys
from sexpdata import loads, dumps, Symbol
lib_header = """EESchema-LIBRARY Version 2.4
@hanya
hanya / mozc_pack.sh
Created February 13, 2019 16:52
Script to pack mozc with submodules for Haiku ports
packVersion=v2.23.2785.102.7
#git clone -b haiku --recursive --depth=1 https://github.com/hanya/mozc.git
#git submodule clone --init --recursive
#git submodule clone --init --recursive src/third_party/zinnia
cd mozc
git pull
cd ..
#tar -cJf mozc-$packVersion.tar.xz
tar -cjf mozc-$packVersion.tar.bz2 \