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
type NoConflict< | |
A extends Record<string | symbol, unknown>, | |
B extends string | number | symbol | |
> = { [K in keyof A]: K extends B ? never : A[K] }; | |
type PropsUnion<A> = { [K in keyof A]: A[K] }[keyof A]; | |
export function withMethods< | |
Origin extends Record<string | symbol, unknown>, | |
Methods extends Record<string | symbol, unknown> |
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
// For Readibility, I've separated it into type. | |
type Keyable = string | number | symbol; | |
// Get value union type. | |
// for `{ a: true, b: 3 }` it will give you `boolean | number` type. | |
// Also for array, it will give you commonest type of the array. | |
type GetValueUnion<T> = T[keyof T]; | |
// This type will inverse keys and values. | |
// for `{ a: 'str', b: 3 }` it will give you `{ 3: 'b', str: 'a' }` type. |
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
//! This is free and unencumbered software released into the public domain. | |
//! | |
//! Anyone is free to copy, modify, publish, use, compile, sell, or | |
//! distribute this software, either in source code form or as a compiled | |
//! binary, for any purpose, commercial or non-commercial, and by any | |
//! means. | |
//! | |
//! In jurisdictions that recognize copyright laws, the author or authors | |
//! of this software dedicate any and all copyright interest in the | |
//! software to the public domain. We make this dedication for the benefit |
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
type TailId = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27; | |
function tailIdOf(word: string): TailId { | |
if (word.length === 0) { | |
return -1; | |
} | |
const last = word[word.length - 1]; | |
if (last < '๊ฐ' || 'ํฃ' < last) { | |
return -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
type TailId = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27; | |
function tailIdOf(word: string): TailId { | |
if (word.length === 0) { | |
return -1; | |
} | |
const last = word[word.length - 1]; | |
if (last < '๊ฐ' || 'ํฃ' < last) { | |
return -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
<!DOCTYPE html> | |
<html lang="ko"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Preact Quickstart</title> | |
</head> | |
<body> | |
<script type="module"> | |
import { html, render, useState, useEffect } from 'https://cdn.skypack.dev/[email protected]/preact/standalone'; |
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
const BoundType = Object.freeze({ | |
Included: 'bound_type::included', | |
Excluded: 'bound_type::excluded', | |
}); | |
class Bound { | |
constructor(type, value) { | |
this.type = type; | |
this.value = value; | |
} |
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 { promises as fs, constants as FS } from 'node:fs'; | |
import { exec } from 'node:child_process'; | |
import { promisify } from 'node:util'; | |
import path from 'node:path'; | |
const ColorRegex = /(?:\\([fFbB])([0-9]))|(\\0)/g; | |
function echo(templates, ...params) { | |
console.log( | |
String.raw(templates, ...params) | |
.replaceAll(ColorRegex, (_, fb, id, zero) => |
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
/* | |
* y = f(x) ๊ผด์ ๊ทธ๋ํ๋ฅผ ๊ทธ๋ฆฌ๋ ํ๋ก๊ทธ๋จ์ ๋๋ค. | |
* ์ด ํ์ผ์ ๋น๋ํ๊ธฐ ์ํด์๋ gdi32๊ฐ ํ์ํฉ๋๋ค. | |
* Dev C++ ๊ธฐ์ค | |
* 1. ํ์ผ > ์๋ก ๋ง๋ค๊ธฐ > ํ๋ก์ ํธ ์์ Console Application์ ๋ง๋ญ๋๋ค. | |
* 2. ํด๋น ํ๋ก์ ํธ๊ฐ ์ด๋ฆฐ ์ํ์์, ํ๋ก์ ํธ > ํ๋ก์ ํธ ์ต์ ์ ์ด๊ณ , ๋งค๊ฐ๋ณ์๋ค ํญ์์ Linker ์นธ์ "-lgdi32" (๋ฐ์ดํ ์์ ๊ฒ)์ ๋ฃ์ต๋๋ค. | |
* | |
* ์ฌ์ฉ ๋ฐฉ๋ฒ | |
* 1. y = f(x)์ ๊ทธ๋ํ์์ f(x)์ ํด๋นํ๋ ๋ถ๋ถ์ ์ ๋ ฅํฉ๋๋ค. | |
* ์ด ๋, ์ฐ์ฐ์ ์ฐ์ ์์๋ ์ ์ฉ๋์ง ์์ผ๋ฉฐ ์ผ์ชฝ๋ถํฐ ๊ฒฐํฉ๋ฉ๋๋ค |
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 { promises as fs } from 'node:fs'; | |
import { join } from 'node:path'; | |
const MODPACK_VERSION = ''; | |
const MODPACK_AUTHOR = ''; | |
const MODPACK_NAME = ''; | |
const mmcPack = JSON.parse( | |
await fs.readFile('mmc-pack.json', { encoding: 'utf8' }) | |
); |