Skip to content

Instantly share code, notes, and snippets.

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

<hmmhmmhm/> hmmhmmhm

๐Ÿงฏ
BURNING!!
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / 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": "ํณ"
};
// Copy-paste into your console (or minify and save as a bookmarklet) to see any DOM in an almost-sorta-working 3D stack of DOM elements.
// The front faces are colored for debugging, if this gist can be fixed, they can return to their normal styling.
(function () {
const MAX_ROTATION = 180;
const DEPTH_INCREMENT = 25;
const PERSPECTIVE = 1000;
const SIDE_FACE_CLASS = 'side-face';
const MAX_DOM_DEPTH = getMaxDepth(document.body);
// Calculate color based on depth, ensuring lighter colors for deeper elements
@hmmhmmhm
hmmhmmhm / tailwind.config.ts
Created April 28, 2024 22:59
Tailwind Responsive Config (xs, 2xs, 3xs, 4xs, 5xs, 6xs, 7xs)
import type { Config } from "tailwindcss";
import { theme } from "tailwindcss/defaultConfig";
const config: Config = {
theme: {
screens: {
...theme?.screens,
xs: "375px",
"2xs": "320px",
"3xs": "280px",