Skip to content

Instantly share code, notes, and snippets.

@Lycolia
Lycolia / GraphemeTool.ts
Last active April 29, 2026 21:26
サロゲートペアやリガチャを含めた文字列の長さを取ったり、切り落とすためのユーティリティ
export class GraphemeTool {
private segment: Intl.Segmenter;
constructor() {
this.segment = new Intl.Segmenter(undefined, { granularity: 'grapheme' });
}
private spread(value: string) {
return [...this.segment.segment(value)].map((item) => {
return item.segment;
@Lycolia
Lycolia / Karabiner-Elements.json
Created February 28, 2026 18:15
Windows like styling Karabiner-Elements.json
{
"profiles": [
{
"complex_modifications": {
"rules": [
{
"description": "VS Codeが前面にあるとき、左Control+@をターミナルトグルとして機能させる",
"manipulators": [
{
"conditions": [
@Lycolia
Lycolia / incorrect-string.length-character-array.txt
Last active September 17, 2025 08:44
正常な文字数判定ができない文字列(合字・リガチャ)
👨‍👩‍👧‍👨‍👩‍👧‍👨‍👩‍👧‍👨‍👩‍👧‍
あ゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙゙
い゚゚゚゚゚゚゚゚゚゚
@Lycolia
Lycolia / recording.ps1
Created September 2, 2025 14:52
Recording the speaker and own microphone
###########################################################
#
# 自分のマイク入力とスピーカー出力を合成して録音するスクリプト
# オンライン会議の録音などに
#
############################################################
Write-Host "録音処理を開始する場合、何かキーを押して下さい..." -NoNewLine
[Console]::ReadKey($true) > $null
$input="Microphone (Sound BlasterX G1)"
@Lycolia
Lycolia / gemini_manifold.py
Created May 15, 2025 23:59
Open WebUI Gemini Manifold Pipe
"""
title: Gemini Manifold Pipe
author: justinh-rahb
author_url: https://github.com/justinh-rahb
funding_url: https://github.com/open-webui
version: 0.1.4
license: MIT
"""
import os
@Lycolia
Lycolia / index.js
Last active February 22, 2024 16:00
Error handling benchmark at JavaScript
const errorObject = (param) => {
if (param === true) {
return {
isError: false,
payload: 'TRUE',
};
} else {
return {
isError: true,
payload: 'ERR',
@Lycolia
Lycolia / misskey-notes-remover.php
Last active April 7, 2026 01:28
Misskey notes remover
<?php
# =====================================================
# Confirmed work with Misskey 13.12.2
# Requires openssl extension and PHP 7.4.0 or later
# Edit php.ini
# ;extension=openssl -> extension=openssl
# =====================================================
set_time_limit(0);
# ==================== Config Start ===================
@Lycolia
Lycolia / index.html
Last active May 22, 2023 18:53
Create Slack reminder command utillity
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Slack Reminder Creator</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<script>
const inputState = {
chName: '',
@Lycolia
Lycolia / stable-diffusion-webui-preset.ipynb
Last active May 3, 2023 19:15
Stable Diffusion web UI(AUTOMATIC1111) setup preset
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Lycolia
Lycolia / yarpp-template-thumbnail.php
Last active March 30, 2023 11:48
YARPP thumbnail template for SANGO theme
<?php
function get_post_data($post_id) {
$url = esc_url(get_permalink($post_id));
$title = esc_attr(get_the_title($post_id));
$img = '';
if (has_post_thumbnail($post_id)) {
$img = get_the_post_thumbnail_url($post_id, 'thumb-520');
} else {