Skip to content

Instantly share code, notes, and snippets.

View Cayahuanca's full-sized avatar
🍞
Unity Time

優希 (Yuki) Cayahuanca

🍞
Unity Time
View GitHub Profile
@Cayahuanca
Cayahuanca / TMPNameUpdater.cs
Created March 13, 2025 16:13
Auto Rename GameObject Name to Text_XXXXX (XXXXX from TextMeshPro's text)
using UnityEngine;
using UnityEditor;
using TMPro;
namespace Praecipua.EE
{
[InitializeOnLoad]
public static class TMP_NameUpdater
{
private static GameObject lastSelectedObject = null;
@Cayahuanca
Cayahuanca / Sunrise URL Generator.html
Created March 4, 2025 15:26
JR西日本 e5489 の、サンライズの検索 URL を生成する。e5489 の画面では、席種や出雲・瀬戸を切り替えるたびに、日付や乗車駅を入力し直しになり、非常に面倒くさいが、その手間を省略する。姫路より西側の、分離以降は対応していない。
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>サンライズ検索</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
@Cayahuanca
Cayahuanca / Sort2-id-date.py
Last active August 27, 2024 17:52
VRCX のデータベースを、マージするときに使用する。データベースから、テーブルごとに .sql ファイルを作り、それに対して行う。
# 日付時刻と、id(int) の主キーがある場合のファイル
import re
import argparse
import os
def process_files(file1, file2):
# 拡張子を取得
base1, ext1 = os.path.splitext(file1)
base2, ext2 = os.path.splitext(file2)
@Cayahuanca
Cayahuanca / rdp-setcert.ps1
Last active May 15, 2024 10:14
Scripts that uses Cloudflare DNS to get a Let's Encrypt certificate and set that certificate to Windows RDP. It needs Ubuntu on WSL with certbot and python3-certbot-dns-cloudflare.
# 証明書のドメイン名
$domain = "example.com"
# PFX のパスワード
$pfxPassword = "P@sSw0rD"
# WSLでスクリプトを実行し、PFXファイルのパスを取得
$runWSL = & wsl bash -c "~/rdp-wsl-certbot.sh"
$line = $runWSL -split "`n" | Where-Object { $_ -match "PFX_WINDOWS_PATH:" }
$pfxWindowsPath = $line -replace "PFX_WINDOWS_PATH:\s*", ""
@Cayahuanca
Cayahuanca / UnityCrasher.cs
Created November 18, 2023 19:18
Code to manually crash Unity Editor.
using System.Diagnostics;
using UnityEditor;
using UnityEngine;
using UnityEngine.Diagnostics;
namespace Praecipua.EE
{
public class UnityCrasher : EditorWindow
{
[MenuItem("Window/Praecipua/[Danger] Crash Unity")]
@Cayahuanca
Cayahuanca / ExtractUnityPackage.py
Last active October 16, 2023 08:13
A Python script that extracts UnityPackage without using Unity.
import os
import argparse
import shutil
import tarfile
def extract_tar_to_folder(unitypackage_file, copy_meta, force_overwrite):
# Unitypackage ファイルの名前から拡張子を取り除いたフォルダを作成
folder_name = os.path.splitext(unitypackage_file)[0]
# 上述のフォルダがすでに存在するかチェック