Skip to content

Instantly share code, notes, and snippets.

View hmmhmmhm's full-sized avatar
๐Ÿงฏ
BURNING!!

<hmmhmmhm/> hmmhmmhm

๐Ÿงฏ
BURNING!!
View GitHub Profile
@hmmhmmhm
hmmhmmhm / gpt-numbers-station.js
Last active March 8, 2024 05:37
Random Numbers Broadcasting by GPT
const encodingTable = {
"A": "ํ€", "a": "ํš", "B": "ํ", "b": "ํ›", "C": "ํ‚", "c": "ํœ", "D": "ํƒ", "d": "ํ",
"E": "ํ„", "e": "ํž", "F": "ํ…", "f": "ํŸ", "G": "ํ†", "g": "ํ ", "H": "ํ‡", "h": "ํก",
"I": "ํˆ", "i": "ํข", "J": "ํ‰", "j": "ํฃ", "K": "ํŠ", "k": "ํค", "L": "ํ‹", "l": "ํฅ",
"M": "ํŒ", "m": "ํฆ", "N": "ํ", "n": "ํง", "O": "ํŽ", "o": "ํจ", "P": "ํ", "p": "ํฉ",
"Q": "ํ", "q": "ํช", "R": "ํ‘", "r": "ํซ", "S": "ํ’", "s": "ํฌ", "T": "ํ“", "t": "ํญ",
"U": "ํ”", "u": "ํฎ", "V": "ํ•", "v": "ํฏ", "W": "ํ–", "w": "ํฐ", "X": "ํ—", "x": "ํฑ",
"Y": "ํ˜", "y": "ํฒ", "Z": "ํ™", "z": "ํณ"
};
@hmmhmmhm
hmmhmmhm / gpt.js
Created December 5, 2023 06:23
Massive JSON Convert GPT
import fs from "fs";
import OpenAI from "openai";
const openai = new OpenAI({
apiKey: "์—ฌ๊ธฐ์— ์ฝ”๋“œ๋ฅผ ๋„ฃ์œผ์‹œ์˜ค",
});
const prompt = `์•„๋ž˜ ์ฃผ์–ด์ง€๋Š” ์˜์–ด JSON์„ ์ผ๋ณธ์–ด๋กœ ๋ฒˆ์—ญํ•ด์ค˜`
export const chunk = (arr, size) => {
@hmmhmmhm
hmmhmmhm / mangoMotion.ts
Created July 28, 2023 04:00
๋ง๊ณ ๋ณด๋“œ ์•„์ดํ”„๋ ˆ์ž„ ๋‚ด ๋ชจ์…˜ ํšจ๊ณผ
import { RefObject, useEffect, useRef } from 'react'
export const applyMangoMotion = (iframeRef: RefObject<HTMLIFrameElement>) => {
if (!iframeRef.current) return
const iframe = iframeRef.current
const iframeWin = iframe.contentWindow || iframe
const iframeDoc = iframe.contentDocument || (iframeWin as any).document
const style = iframeDoc.createElement('style')
@hmmhmmhm
hmmhmmhm / google_login.ts
Created July 21, 2023 00:55 — forked from Brandawg93/google_login.ts
Login to Google Account via Puppeteer
import puppeteer from 'puppeteer-extra';
import pluginStealth from 'puppeteer-extra-plugin-stealth'; // Use v2.4.5 instead of latest
import * as readline from 'readline';
puppeteer.use(pluginStealth());
// Use '-h' arg for headful login.
const headless = !process.argv.includes('-h');
// Prompt user for email and password.
@hmmhmmhm
hmmhmmhm / fine-tuning-open-ai.ts
Created July 18, 2023 08:05
Fine Tuning Open AI
import fs from "fs";
import * as tokenizer from "gpt-3-encoder";
import { Configuration, OpenAIApi } from "openai";
import { logger } from "./utils/logger.js";
import jsonl from "jsonl";
import inquirer from "inquirer";
import chalk from "chalk";
export const loadProjectDataFromJSON = (
assetPath: string
@hmmhmmhm
hmmhmmhm / gist:39922d389eb4b00a9c320e0f0af97d85
Last active September 20, 2022 05:19
Remove some depth of typescript interface
interface T1 {
name: string;
email: string;
properties: {
creators: [{
name: string;
}];
color: string;
}
}
@hmmhmmhm
hmmhmmhm / VueWithReactComponent.tsx
Created June 22, 2022 04:41
Vue in React Component
import { useEffect, useRef } from 'react'
interface IComponentProps<T> {
// TODO
}
const template = `
<div></div>
`
@hmmhmmhm
hmmhmmhm / add_in_swagger.html
Created April 8, 2022 06:47
Swagger dark theme patch
<!-- Copy and paste all the codes below onto the </body> Swagger HTML -->
<!-- Customize Code START -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/darkreader/4.9.39/darkreader.min.js"
integrity="sha512-ZCoQYqkc9/Yokyl2tJRRGKY/nrcpeF01NMeGoF7QPEoMSneYZlxUqSFnvVGH+CWBsm1HuQyWoq9Jp1SeTIukEA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<style>
.topbar {
opacity: 0;
margin-top: -80px;
@hmmhmmhm
hmmhmmhm / smallest-sandbox.js
Last active April 7, 2022 18:21
Lexical Free Smallest Sandbox
const outerLexicalEnvironment = {
window: {},
global: {},
Object: {},
Function: {},
self: {},
globalThis: {},
Error: {},
TypeError: {},
JSON: {},
const Excel = require("exceljs");
const workbook = new Excel.Workbook();
void (async () => {
const excel = await workbook.xlsx.readFile("before.xlsx");
const worksheets = excel.worksheets;
// ์ฒซ ๋ฒˆ์งธ ์‹œํŠธ์ •๋ณด ์–ป์–ด์˜ค๊ธฐ
const originSheet = worksheets[0];