Skip to content

Instantly share code, notes, and snippets.

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

<hmmhmmhm/> hmmhmmhm

๐Ÿงฏ
BURNING!!
View GitHub Profile
@hmmhmmhm
hmmhmmhm / README.md
Created January 24, 2025 06:09
MeloTTS Docker Gradio API Script (Typescript)

๐Ÿ’ฌ What I experienced

I tried to use MeloTTS as an API in a hurry, but it didn't install properly on my Mac environment.

So I built my environment with Docker and tried to use MeloTTS, which resulted in a Gradio Local Web UI with no API.

It looks like MeloTTS is still working on creating an official API, so I created my own local fetch code that mimics the Gradio client's call to make it work and be usable.

๐Ÿค” What is this?

@GOROman
GOROman / webrtc.cpp
Last active January 7, 2025 14:50
Using DataChannel in the OpenAI Realtime API Embedded SDK
#ifndef LINUX_BUILD
#include <driver/i2s.h>
#include <opus.h>
#endif
#include <esp_event.h>
#include <esp_log.h>
#include <string.h>
#include "main.h"
@ohmeow
ohmeow / 06_a_langraph_instructor.ipynb
Created October 11, 2024 20:34
LangGraph + Instructor
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@OrionReed
OrionReed / dom3d.js
Last active June 19, 2025 01:28
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ยฏ\\_(ใƒ„)_/ยฏ
@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": "ํณ"
};
@vzts
vzts / avoid-in-app.js
Last active August 19, 2024 05:38
์นด์นด์˜คํ†ก ์ธ์•ฑ ๋ธŒ๋ผ์šฐ์ € ํƒˆ์ถœํ•˜๊ธฐ ์ฝ”๋“œ ๊ฐ€์žฅ ์‹ฌํ”Œํ•˜๊ฒŒ ์ •๋ฆฌ (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 / packing.ts
Last active November 1, 2021 07:21
typescript grid item sort & align algorithm
export interface PackNode {
w: number
h: number
x?: number
y?: number
used?: boolean
right?: PackNode
down?: PackNode
fit?: PackNode
}
@hmmhmmhm
hmmhmmhm / googleTTS.ts
Created June 20, 2021 06:30
๊ตฌ๊ธ€ TTS API ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ & ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์˜ˆ์ œ (Google TTS API Javascript & Typescript Usage)
// How To Authentication: https://cloud.google.com/docs/authentication/getting-started#auth-cloud-implicit-nodejs
import textToSpeech from '@google-cloud/text-to-speech'
import fs from 'fs'
import util from 'util'
// Creates a client
const client = new textToSpeech.TextToSpeechClient()
const getTTSContent = async (props: {
@hmmhmmhm
hmmhmmhm / clovaTTS.ts
Created June 20, 2021 06:04
๋„ค์ด๋ฒ„ ํด๋กœ๋ฐ” TTS API ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ & ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์‚ฌ์šฉ๋ฒ• (Naver Clova TTS API Javascript & Typescript Usage)
import axios from 'axios'
import path from 'path'
import fs from 'fs'
import querystring from 'qs'
import { Readable } from 'stream'
export const Speakers = [
/**
* ๋‹ค์ธ (์—ฌ์•„ ๋ชฉ์†Œ๋ฆฌ)
*/
@hmmhmmhm
hmmhmmhm / fpe.ts
Last active June 20, 2021 07:49
javascript format preserving
import fe1 from 'node-fe1-fpe'
export interface IFPESetting {
min: number
max: number
privateKey: string
publicKey: string
}
export const encrypt = ({