Skip to content

Instantly share code, notes, and snippets.

!define event enum
skinparam backgroundColor #f0fefe
skinparam class {
BackgroundColor #fffcfa
BorderColor #433
ArrowColor #433
ArrowFontSize 14
ArrowFontColor #433
ArrowFontStyle bold
ArrowThickness 0.7
@kanonji
kanonji / bookmarklet
Created March 30, 2023 10:55
GitHubのissueにて埋め込みコードの縦幅を広げるbookmarklet "Expand embedded height"
javascript:(function(){Array.from(document.getElementsByClassName("blob-wrapper-embedded")).forEach(e=>{e.style.maxHeight="initial"});})();
module github.com/uptrace/bun/example/rel-belongs-to
go 1.18
replace github.com/uptrace/bun => ../..
replace github.com/uptrace/bun/extra/bundebug => ../../extra/bundebug
replace github.com/uptrace/bun/dialect/sqlitedialect => ../../dialect/sqlitedialect
@kanonji
kanonji / adb_connect.bat
Created October 23, 2021 15:23
実行するだけで adb tcpip 5555 && adb connect ${ipAddr}:5555 をやってくれるWindowsバッチファイルusing PowerShell
@echo off
powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File .\adb_connect.ps1
@kanonji
kanonji / set_base_color.py
Created July 18, 2021 13:29
Set Base Color for multiple materials of multiple objects name starts with 2nd arg.
# https://blender.stackexchange.com/a/158902
def srgb_to_linearrgb(c):
if c < 0: return 0
elif c < 0.04045: return c/12.92
else: return ((c+0.055)/1.055)**2.4
# https://blender.stackexchange.com/a/158902
def hex_to_rgb(h,alpha=1):
r = (h & 0xff0000) >> 16
g = (h & 0x00ff00) >> 8
@kanonji
kanonji / BarGenerator.cs
Last active January 23, 2022 15:10
Unityのエディタ拡張の書き始めに迷う時のテンプレート https://docs.unity3d.com/ja/current/ScriptReference/EditorGUILayout.html
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace Kanonji.Editor {
public class BarGenerator : EditorWindow {
private GameObject subject;

これは何か?

Windows 10を使っていて、フォルダを右クリックして「このフォルダをPATHに追加」という操作がしたくて、Windows Registryへの変更と、PowerShellを使う事で実現できたので、後に自分が新しいPC等で再利用できる様に記録したgistです。

  • フォルダを右クリックした際のコンテキストメニューに「このフォルダをPATHに追加」という項目を追加。
  • 「このフォルダをPATHに追加」をクリックすると、ユーザー環境変数のPathの最後に、そのフォルダの絶対パスが追加される。

注意

  • Windows Registryに変更を加える。
@kanonji
kanonji / bookmarklet
Last active March 11, 2020 17:48
2020-03-11~2020-04-12まで無料公開の小学館版学習まんが 少年少女日本の歴史 https://kids-km3.shogakukan.co.jp/ で←→キーでページをめくれる様にするbookmarklet
javascript:(function(){const e=document.getElementById("tap_left_area"),t=document.getElementById("tap_right_area");document.addEventListener("keydown",n=>{"ArrowLeft"===n.key&&e.click(),"ArrowRight"===n.key&&t.click()})})();
@kanonji
kanonji / bookmarklet
Created November 12, 2019 18:33
Kindle メモとハイライトを保存しやすいDOMに調整するbookmarklet
javascript:(function(){$("#annotation-scroller").appendTo("body");$("#a-page").remove();$("#a-popover-root").remove();$(".a-popover-trigger").parent().parent().remove();$(".kp-notebook-row-separator").css("width","inherit");$(".kp-notebook-print-override").css("width","inherit")})();
@kanonji
kanonji / bookmarklet
Created October 31, 2019 17:26
https://fortee.jp/phpcon-2019/timetable のタイムテーブルの横スクロールバーが出ない様にするbookmarklet
javascript:(function(){$(".container.main").css("width","initial");$(".timetable.size-normal").css("width","initial");$(".scale").css("width","5%");$(".date").css("width","95%").css("display","table").css("table-layout","fixed");$(".track").css("width","initial").css("float","none").css("display","table-cell")})();