Skip to content

Instantly share code, notes, and snippets.

View thc282's full-sized avatar
🎮
Gaming Student

thc282

🎮
Gaming Student
View GitHub Profile
@thc282
thc282 / jsonValidator.js
Last active February 26, 2026 04:10
Check JSON validation
(function() {
const text = document.body.textContent; /* define text properly */
try {
JSON.parse(text);
alert("✅ JSON is valid!");
} catch (error) {
console.error("❌ Invalid JSON: " + error.message);
/* Extract position from error message */
const match = error.message.match(/position (\d+)/);
@thc282
thc282 / 官方整合包.md
Last active March 10, 2026 13:35
[HoYoverse]米哈遊 Sticker整合包 (HoYoLab Sticker)

Whatsapp 米哈遊整合包貼圖

原神

派蒙的畫作

[第一彈][【派蒙的畫作】第一彈] [第二彈][【派蒙的畫作】第二彈] [第三彈][【派蒙的畫作】第三彈] [第四彈][【派蒙的畫作】第四彈] [第五彈][【派蒙的畫作】第五彈] [第六彈][【派蒙的畫作】第六彈]
[][【派蒙的畫作】第一彈] [][【派蒙的畫作】第二彈] [][【派蒙的畫作】第三彈] [][【派蒙的畫作】第四彈] [][【派蒙的畫作】第五彈] [][【派蒙的畫作】第六彈]
[第七彈][【派蒙的畫作】第七彈] [第八彈][【派蒙的畫作】第八彈] [第九彈][【派蒙的畫作】第九彈] [第十彈][【派蒙的畫作】第十彈] [第十一彈][【派蒙的畫作】第十一彈] [第十二彈][【派蒙的畫作】第十二彈]
@thc282
thc282 / extractWEBM.ahk
Last active November 19, 2025 07:48
Extract the launcher background
#Requires AutoHotkey v2.0
#SingleInstance Force
filePath := "C:\Users\thc282\AppData\Roaming\Cognosphere\HYP\1_1\fedata\Cache\Cache_Data\data_1"
try {
fileContent := FileRead(filePath)
} catch Error as e {
MsgBox "❌ 無法讀取:" e.Message
ExitApp
}
@thc282
thc282 / 原神新手指南.md
Last active February 20, 2026 15:47
原神新手建議

新手指南 [最詳盡版]

一定要 看遊戲內的教學!教學!教學!
善用冒險之證
遇到問題先自己找一下, 不要一來就問別人. 真搜不到再禮貌地問

跑圖:

  1. 優先體驗劇情
  2. 開圖順序建議: 蒙德>璃月(石門過, 不要經雪山)>稻妻(30等)>層岩(旅人間章)>須彌雨林>沙漠>楓丹>納塔>挪德卡萊

2.1 選擇性解圖:雪山, 淵下宮, 層岩巨淵, 沉玉谷, 奧奇坎納塔(建議先做, 再過納塔主線第五幕), 悠悠度假村

@thc282
thc282 / Constants.js
Last active April 7, 2025 17:01
Convert HKgrid80 <=> WGS84 with JavaScript (HK80 Grid, Latitude & Longitude convertion)
// constants
var N_0 = 819069.80; // northing of projection origin
var E_0 = 836694.05; // easting of projection origin
var m_0 = 1; // scale factor
var lat_0 = (22 + 18 / 60 + 43.68 / 3600) * Math.PI / 180; // DMS to radian, lat of projection origin
var lng_0 = (114 + 10 / 60 + 42.80 / 3600) * Math.PI / 180; // DMS to decimal, lng of projection origin
var M_0 = 0; // meridian distance measured from equator to origin
var a = 0;
var f = 0;

Error

image


Step to solve

image

  1. Goto HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
  2. If dont have Autorun. Add a String Value(字串值) -> Autorun
  3. Change & Add &gt;nul | E.g. — chcp xxxxx -> chcp xxxxx&gt;nul
@thc282
thc282 / canvasCapture.md
Last active February 8, 2025 19:06
All threeJS useful script

⚠⚠⚠⚠⚠this must be set when new a renderer object⚠⚠⚠⚠⚠
{preserveDrawingBuffer: true}

//⚠⚠⚠⚠⚠this must be set when new a renderer object⚠⚠⚠⚠⚠
//{preserveDrawingBuffer: true}
const renderer = new THREE.WebGLRenderer({preserveDrawingBuffer: true});
//set a id for getting the canvas
renderer.domElement.id = 'screenshot';
@thc282
thc282 / interpolation.md
Last active June 25, 2024 09:26
the code to calculate the interpolation

1. First calculate the speed

speed = (currentTime - startTime) / (endTime - startTime)

frame = Date.now()
const speed = (frame - positions[0].frame) / (positions[0 + delay].frame - positions[1 + delay].frame);
  • The interpolation factor speed represents the position between the two most recent positions in the positions array.
  • frame is the current frame of the game.
  • positions[0].frame is the frame of the most recent position in the positions array.
  • positions[0 + delay].frame and positions[1 + delay].frame are the frames of the two most recent positions, with a delay offset.
@thc282
thc282 / ExecutionPolicyFix.md
Last active June 25, 2024 02:34
fix ps1 cannot be loaded because running scripts is disabled on this system

To fix the ExecutionPolicy

ps1 cannot be loaded because running scripts is disabled on this system

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser