This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import axios from 'axios' | |
| import path from 'path' | |
| import fs from 'fs' | |
| import querystring from 'qs' | |
| import { Readable } from 'stream' | |
| export const Speakers = [ | |
| /** | |
| * ๋ค์ธ (์ฌ์ ๋ชฉ์๋ฆฌ) | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'isomorphic-unfetch' | |
| import axios from 'redaxios' | |
| import { JSDOM, CookieJar, VirtualConsole, ResourceLoader } from 'jsdom' | |
| interface JSDOMCookie { | |
| key: string | |
| value: string | |
| domain: string | |
| path: string | |
| hostOnly: boolean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const when = ( | |
| condition: () => boolean | Promise<boolean>, | |
| timeoutMs = 0, | |
| repeatMs = 500 | |
| ) => { | |
| return new Promise<void>((resolve) => { | |
| const startTime = Date.now() | |
| const checkFlag = async () => { | |
| if (await condition()) { | |
| resolve() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ์ด ์์ ๋ณด๊ณ ๊ฐ๋ช ๋ฐ์ ๋ง๋ฌ ๐ใ ใ ใ https://youtu.be/UUJKiTcnGK0 | |
| [...Array(9)].map((_,a,b)=>b.map((_,b)=>a*b+a+b+1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import JSZip from 'jszip' | |
| // Filter Example: https://gist.github.com/hmmhmmhm/f1383a32b904e85cc7b352ad49a8c8e9 | |
| // import { applyFilters } from './filter' | |
| export interface ICollectedFile { | |
| fileName: string | |
| fileExt: string | |
| filePaths: string[] | |
| originName: string | |
| file: JSZip.JSZipObject |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface IFilterInput { | |
| container: JSZip | |
| data: ICollectedData | |
| option: IFilterOption | |
| state: IState | |
| } | |
| export interface IFilterOption { | |
| styleType: 'basic' | 'poem' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * useScroll React custom hook | |
| * Usage: | |
| * const { scrollX, scrollY, scrollDirection } = useScroll(); | |
| */ | |
| import { useState, useEffect } from "react"; | |
| export function useScroll() { | |
| const [lastScrollTop, setLastScrollTop] = useState(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ~~(min + Math.random() * max) | |
| // 0 ~ 100 | |
| ~~(Math.random() * 100) | |
| // 1 ~ 5 | |
| ~~(1 + Math.random() * 5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // if you want better performance, use fpe | |
| // https://gist.github.com/hmmhmmhm/89e200e3501b4d155901baee3cae0f74 | |
| const rand = (max) => ~~(Math.random() * max) | |
| const items = [] | |
| while(items.length === 100){ | |
| const item = rand(100) | |
| if(!items.includes(item)) | |
| items.push(item) |