Skip to content

Instantly share code, notes, and snippets.

@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 / 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
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 / 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"});})();
!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 / stylus_for_twitter.css
Created July 6, 2024 16:40
Twitter(a.k.a x)の検索結果の中で、ユーザー名からヒットしたツイートを(不完全ながら)隠すStylus CSS
div[data-testid="cellInnerDiv"]:not(:has(div[data-testid="tweetText"]>span:not([dir="ltr"])+span:not([dir="ltr"]))) {
opacity: 0.15;
height: 53px;
overflow: hidden;
}
/*
Twitter(a.k.a x)の検索結果の中で、ユーザー名からヒットしたツイートを(不完全ながら)隠すStylus CSSです。
2023年8月頃にチャレンジして、誤判別する課題が取り除けず1度断念したものだけど、そこを許容できればある程度は使えるかもしれません。
あと、高度な検索を使うと破綻する場合もあった気がしますが、よく覚えてません。
@kanonji
kanonji / allman-style
Last active March 22, 2025 09:10
Check the revisions at https://gist.github.com/kanonji/b04662d890340aee07265a82267a406b/revisions to see what the diff looks like."
if (newCondition)
{
doSomethingElse();
}