Skip to content

Instantly share code, notes, and snippets.

View hmmhmmhm's full-sized avatar
🚀
Go MARS!!

hmmhmmhm hmmhmmhm

🚀
Go MARS!!
View GitHub Profile
@hmmhmmhm
hmmhmmhm / backlight.css
Created October 2, 2024 00:05
Backlight Pure CSS, 백라이트 효과를 CSS로 구현한 간단 코드
.backlight:after {
content: "";
width: 100%;
height: 100%;
top: 0;
position: absolute;
background: inherit;
filter: blur(20px);
z-index: -1;
}
@hmmhmmhm
hmmhmmhm / avoid-in-app.js
Created August 19, 2024 05:38 — forked from vzts/avoid-in-app.js
카카오톡 인앱 브라우저 탈출하기 코드 가장 심플하게 정리 (2023.10.27 동작 확인)
const userAgent = navigator.userAgent.toLowerCase()
if (/kakaotalk/.test(userAgent)) {
location.href =
'kakaotalk://web/openExternal?url=' + encodeURIComponent(location.href)
setTimeout(() => {
location.href = /ipad|iphone|ipod/.test(userAgent)
? 'kakaoweb://closeBrowser'
: 'kakaotalk://inappbrowser/close'
})
@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",
// 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 / 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;
}
}