Skip to content

Instantly share code, notes, and snippets.

@td2sk
td2sk / input.txt
Last active February 3, 2024 17:10
■■□□□□□□□□■■
■■□ □■■
□□□ □□□
□ □
□ □
□ □
□□□ □□
■■□□□□□□□ □■
// ==UserScript==
// @name Redirect for akizuki catalog
// @namespace http://tampermonkey.net/
// @version 2024-01-26
// @description Redirects from the old akizuki product page to the new one.
// @author td2sk
// @match https://akizukidenshi.com/catalog/g/*/
// @icon https://www.google.com/s2/favicons?sz=64&domain=akizukidenshi.com
// @grant none
// ==/UserScript==
@td2sk
td2sk / os.dsc.yaml
Last active October 9, 2023 12:05
My DSCs
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
configurationVersion: "0.2.0"
resources:
# Show FileExt (reboot required)
- resource: Registry
directives:
description: Show extensions
allowPrerelease: true
settings:

rinna.cpp windows パッチ

概要

rinna/japanese-gpt-neox-3.6b-instruction-ppo の llama.cpp 対応を Windows で動かすやつ

手順

  1. パッチ元(後述)の対象コミットを取得
@td2sk
td2sk / update_qmk_c_cpp_properties.md
Last active March 24, 2023 17:39
tool for VSCode for QMK development

QMK VSCode 設定

概要

  • QMK の開発時に VSCode で補完が適切に効くようにするツール
  • qmk generate-compilation-database コマンドと違い、keymap.c でも適切に動作する

事前準備

最低限の設定を記載した $QMK_ROOT/.vscode/c_cpp_properties.json を事前に作成しておく

@td2sk
td2sk / kicad_matrix.py
Created January 25, 2023 15:43
Grid placement in Kicad PCB editor
import pcbnew
# index (1-origin) to Reference Text
def diode(index: int) -> str:
return f"D{index}"
def switch(index: int) -> str:
return f"SW{index}"
@td2sk
td2sk / setup.sh
Last active January 14, 2023 15:51
Raspberry Pi 2 に Home Assistant を導入する
# 公式サイトにある Docker を使った手順では Addon 導入ができないなど機能制限が多い
# 推奨は Home Assistant Operating System の導入だが、 Raspberry Pi OS に入れたい場合は以下手順を取る
# この手順では AppArmor や cgroups などセキュリティ周りの設定が不完全になることに注意
# 導入後に設定画面の指示に従って適宜修正が必要
# docker を入れる
curl https://get.docker.com | sh
# 一旦再起動
@td2sk
td2sk / README.md
Created September 8, 2022 14:31
support Waifu Diffusion on Google Colab Free

Google Colab 無料枠で Waifu Diffusion を動かす

概要

  • Waifu Diffusion を Colab 無料枠で動かそうとするとメモリが溢れてしまう
    • wd-v1-2-full-ema.cpkt には画像生成するだけなら不要な情報が乗っているため
  • 本来ならfull-emaでないモデルを用意すべき
  • 暫定案としてVRAMに直接ロードするようパッチを当てると、メモリが節約できてギリギリ動作する

対応

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.