Skip to content

Instantly share code, notes, and snippets.

View adhrinae's full-sized avatar
๐Ÿ“š

Dohyung Ahn adhrinae

๐Ÿ“š
View GitHub Profile
@longfin
longfin / writing.md
Last active October 31, 2024 05:50
์—”์ง€๋‹ˆ์–ด๋ฅผ ์œ„ํ•œ ๊ธ€์“ฐ๊ธฐ

์ด ๊ธ€์€ Heinrich Hartmann ๋‹˜์ด ์ž‘์„ฑํ•˜์‹  ๊ธ€์„ ํ•œ๊ตญ์–ด๋กœ ๋ฒˆ์—ญํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์›๋ฌธ์€ https://www.heinrichhartmann.com/posts/writing/ ์—์„œ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.


๊ธ€์“ฐ๊ธฐ๋Š” ํฐ ์กฐ์ง์—์„œ ์˜ํ–ฅ๋ ฅ์„ ๋ฐœํœ˜ํ•˜๋Š” ๋ฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. ๊ฒฝ๋ ฅ ์žˆ๋Š” ์†Œํ”„ํŠธ์›จ์–ด ์—”์ง€๋‹ˆ์–ด๋กœ์„œ์˜ ๊ธ€์“ฐ๊ธฐ๋Š” ์ง๋ฌด ๋ฒ”์œ„๋ฅผ ํ™•์žฅํ•˜๊ณ  ๊ฒฝ๋ ฅ์„ ๋ฐœ์ „์‹œํ‚ค๊ธฐ ์œ„ํ•ด ํš๋“ํ•ด์•ผ ํ•˜๋Š” ๊ฐ€์žฅ ์ค‘์š”ํ•œ ๊ธฐ์ˆ ์ž…๋‹ˆ๋‹ค.

๊ธ€์“ฐ๊ธฐ๋Š” ์–ด๋ ต์Šต๋‹ˆ๋‹ค. ๋งŽ์€ ์†Œํ”„ํŠธ์›จ์–ด ์—”์ง€๋‹ˆ์–ด๋“ค์ด ๊ธ€์“ฐ๊ธฐ์™€ ์”จ๋ฆ„ํ•˜์ฃ . ์ €๋„ ๊ฐœ์ธ์ ์œผ๋กœ ๋ฌธํ•™์— ๋Œ€ํ•œ ๊ด€์‹ฌ์ด ์—†๊ธฐ ๋•Œ๋ฌธ์— ๊ธ€์“ฐ๊ธฐ๊ฐ€ ์ž์—ฐ์Šค๋Ÿฝ์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

@ClickerMonkey
ClickerMonkey / types.ts
Last active August 8, 2024 00:25
Typescript Helper Types
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// when T is a tuple, Y is returned, otherwise N
// valid tuples = [string], [string, boolean],
// invalid tuples = [], string[], (string | number)[]
@hrdtbs
hrdtbs / react-hooks_exhaustive-deps.md
Last active October 10, 2023 09:36
ใƒกใƒขใ€ใชใœ`react-hooks/exhaustive-deps`ใฏใŸใ componentDidMountใฎใ‚ˆใ†ใซไฝฟใ„ใŸใ„ใ ใ‘ใชใฎใซไพๅญ˜้–ขไฟ‚ใ‚’ๅ…ฅใ‚Œใฆใใ‚‹ใฎใ‹

ใชใœreact-hooks/exhaustive-depsใฏใŸใ componentDidMountใฎใ‚ˆใ†ใซไฝฟใ„ใŸใ„ใ ใ‘ใชใฎใซไพๅญ˜้–ขไฟ‚ใ‚’ๅ…ฅใ‚Œใฆใใ‚‹ใฎใ‹

export const Example = ({ loadOnlyOnce }) => {
    useEffect(() => {
      loadOnlyOnce()
    }, [loadOnlyOnce]) // โ† WHY๏ผŸ
}
@getify
getify / 1.md
Last active October 15, 2020 01:44
BetterPromise: a strawman experiment in subclassing Promise and "fixing" a bunch of its awkward/bad parts

Some things that are "better" with this BetterPromise implementation:

  • BetterPromise # then(..) accepts a BetterPromise (or Promise) instance passed directly, instead of requiring a function to return it, so that the promise is linked into the chain.

    var p = BetterPromise.resolve(42);
    
    var q = Promise.resolve(10);
    
    p.then(console.log).then(q).then(console.log);

3 Gripes With React

I started using React 3.5 years ago, and I still love it. It was such a well-designed solution that not much has changed since then, only superficial stuff like naming. What I learned then is still wholly applicable today because it's such a good idea (although now you can choose from many other libraries). On top of that, we now benefit from an entirely new architecture (fiber) without changing much.

@redism
redism / kr_won_to_backquote.sh
Created April 26, 2017 16:20
macOS Sierra์—์„œ ์›ํ™”(โ‚ฉ) ๋Œ€์‹  ๋ฐฑ ์ฟผํŠธ(`) ์ž…๋ ฅํ•˜๊ธฐ
#!/bin/bash
if [ -f ~/Library/KeyBindings/DefaultkeyBinding.dict ]; then
echo "~/Library/KeyBindings/DefaultkeyBinding.dict already exists"
exit -1
fi
mkdir -p ~/Library/KeyBindings
cat << EOF > ~/Library/KeyBindings/DefaultkeyBinding.dict
{
"โ‚ฉ" = ("insertText:", "\`");
@dfdgsdfg
dfdgsdfg / Logger.js
Last active April 21, 2017 06:23
Simple logger for browser side
/* eslint-disable no-console, consistent-return */
const logger = (function Logger() {
const prefix = "[MYAPP]";
const logLevelPreset = [
'SILENT',
'ERROR',
'WARN',
'INFO',
'DEBUG',
@casamia918
casamia918 / introrx.md
Last active August 22, 2024 02:54 — forked from staltz/introrx.md
[Korean ver.] The introduction to Reactive Programming you've been missing

๋‹น์‹ ์ด ๋†“์น˜๊ณ  ์žˆ๋˜ Reactive Programming์— ๋Œ€ํ•œ ์•ˆ๋‚ด (ํ•œ๊ธ€ ๋ฒˆ์—ญ)

The introduction to Reactive Programming you've been missing (Korean ver.)

(by @andrestaltz)

(orginal source: https://gist.github.com/staltz/868e7e9bc2a7b8c1f754)


์ด ํŠœํ† ๋ฆฌ์–ผ์€ ๋น„๋””์˜ค ์‹œ๋ฆฌ์ฆˆ๋„ ์žˆ์Šต๋‹ˆ๋‹ค

@jooyunghan
jooyunghan / monad-in-java.md
Last active November 17, 2023 04:54
ํ•œ๊ธ€๋ฒˆ์—ญ - Functor and monad examples in plain Java

Functor and monad examples in plain Java

์ด ๊ธ€์€ ์šฐ๋ฆฌ๊ฐ€ ์“ด ์ฑ…, 'Reactive Programming with RxJava' ์˜ ๋ถ€๋ก์ด์—ˆ๋‹ค. Reactive programming๊ณผ ๊ด€๋ จ์ด ๊นŠ์€ ์ฃผ์ œ๊ธด ํ•˜์ง€๋งŒ ๋ชจ๋‚˜๋“œ๋ฅผ ์†Œ๊ฐœํ•œ๋‹ค๋Š” ๊ฒŒ ์ฑ…๊ณผ ์ฉ ์–ด์šธ๋ฆฌ์ง€๋Š” ์•Š์•˜๋‹ค. ๊ทธ๋ž˜์„œ ๋‚˜๋Š” ๋”ฐ๋กœ ๋ธ”๋กœ๊ทธ์— ์˜ฌ๋ฆฌ๊ธฐ๋กœ ํ–ˆ๋‹ค. ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ๋‹ค๋ฃจ๋Š” ๋ธ”๋กœ๊ทธ์—์„œ *"๋ฐ˜์€ ๋งž๊ณ  ๋ฐ˜์€ ํ‹€๋ฆด ์ง€ ๋ชจ๋ฅด๋Š” ๋‚˜๋งŒ์˜ ๋ชจ๋‚˜๋“œ ์„ค๋ช…"*์ด๋ž€ ๊ฒƒ์ด ์ƒˆ๋กœ์šด *"Hello World"*๋ผ๋Š” ์ ์„ ๋‚˜๋„ ์ž˜ ์•ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ด ๊ธ€์€ ํŽ‘ํ„ฐ(functor)์™€ ๋ชจ๋‚˜๋“œ(monad)๋ฅผ ์ž๋ฐ” ์ž๋ฃŒ ๊ตฌ์กฐ์™€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ผ๋Š” ๊ฐ๋„์—์„œ ๋ฐ”๋ผ๋ณด๊ณ  ์žˆ์œผ๋ฉฐ, ์ด๋Š” ๊ณต์œ ํ•  ์ •๋„์˜ ๊ฐ€์น˜๋Š” ์žˆ์„๊ฑฐ๋ผ ์ƒ๊ฐํ–ˆ๋‹ค.

@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}