Skip to content

Instantly share code, notes, and snippets.

View refracta's full-sized avatar
🕶️

refracta

🕶️
View GitHub Profile
@refracta
refracta / debugAutoReloadCallback.js
Created May 21, 2025 18:12
debugAutoReloadCallback example
const {TranslationModule} = DWEM.Modules;
socket.key = (keycode) => socket.send(JSON.stringify({msg: 'key', keycode}));
socket.input = (text) => socket.send(JSON.stringify({msg: 'input', text}));
TranslationModule.debugAutoReloadCallback = () => {
socket.key(27);
socket.input('%');
};
@refracta
refracta / example.js
Last active June 19, 2025 22:31
TranslationModule Scripting Example
/**
* Django-admin “Matcher” 객체를 Ajax 로 추가한다.
*
* @param {Object} opts – 전달할 필드
* @param {string} opts.category
* @param {"raw"|"regex"} opts.type
* @param {string} [opts.raw=""] – type="raw" 일 때만
* @param {string} [opts.regexp_source=""] – type="regex" 일 때만
* @param {string} [opts.regexp_flag=""] – type="regex" 일 때만 (e.g. "i")
* @param {Object} opts.replace_value – {ko:"...", en:"..."} 형태
@refracta
refracta / cron-example.md
Created June 22, 2024 17:04
cron-example
version: '3'
services:
  node:
    build: .
    volumes:
      - .:/usr/src
    working_dir: /usr/src
    restart: unless-stopped
 shm_size: 256M
@refracta
refracta / OSBot
Last active December 30, 2023 15:23
OPIcBot Prompt
[[Name]]
OSBot
[[Description]]
영어 말하기 시험인 OPIc 시험을 도와준다.
[[Instructions]]
너는 영어 말하기 시험인 OPIc 시험의 연습을 도와주는 봇이야
너는 두가지 상태에 맞게 응답해야 해, 기본적으로는 한국어로 대답해
@refracta
refracta / install.bat
Created December 30, 2023 11:36
발더스게이트 3 한글 패치 자동 설치기 (한국어 개선 패치 배포)
@echo off
if exist "patcher.ps1" (
del "patcher.ps1" 2>nul
)
for /f %%a in ('type "%~0" ^| find /c /v ""') do set TotalLines=%%a
for /f "tokens=1,* delims=:" %%a in ('findstr /n /c:":PATCHER" "%~0"') do set StartLine=%%a
for /f "skip=%StartLine% delims=" %%i in ('type "%~0"') do (
echo %%i >> patcher.ps1
)
@refracta
refracta / install.bat
Created November 17, 2023 16:05
발더스게이트 3 한글 패치 자동 설치기 (일반 배포용)
@echo off
if exist "patcher.ps1" (
del "patcher.ps1" 2>nul
)
for /f %%a in ('type "%~0" ^| find /c /v ""') do set TotalLines=%%a
for /f "tokens=1,* delims=:" %%a in ('findstr /n /c:":PATCHER" "%~0"') do set StartLine=%%a
for /f "skip=%StartLine% delims=" %%i in ('type "%~0"') do (
echo %%i >> patcher.ps1
)
@refracta
refracta / AutomaticLargeInput.js
Created March 20, 2023 07:21
Large input scaler for ChatGPT
function writeMessage(text) {
document.querySelector('textarea').value = text;
}
function clickSendButton() {
document.querySelector('button.absolute').click();
}
function waitResponse() {
return new Promise(resolve => {
@refracta
refracta / waitFor.js
Last active September 4, 2022 23:22
waitFor.js
function waitFor(checkFunction, checkDelay = 100) {
return new Promise(resolve => {
let i = setInterval(_ => {
try {
let check = checkFunction();
check ? clearInterval(i) || resolve(check) : void 0
} catch (e) {}
}, checkDelay);
});
}
@refracta
refracta / DownloadAllSolvedProblem.js
Created August 20, 2022 05:45
acmicpc auto downloader
// ==UserScript==
// @name DownloadAllSolvedProblem
// @version 0.1
// @author refracta
// @match https://www.acmicpc.net/*
// ==/UserScript==
function waitFor(vf, t) {
return new Promise(r => {
let i = setInterval(_ => {
@refracta
refracta / WindowsFileNameConverter.js
Created July 3, 2022 00:06
WindowsFileNameConverter
value.replaceAll('\\', '\').replaceAll('/', '/').replaceAll(':', ':').replaceAll('*', '*').replaceAll('?', '?').replaceAll('"', '"').replaceAll('<', '').replaceAll('>', '').replaceAll('|', '|')