Skip to content

Instantly share code, notes, and snippets.

View vreality64's full-sized avatar
๐Ÿค 
Happy

Ian Park vreality64

๐Ÿค 
Happy
View GitHub Profile
@vreality64
vreality64 / clean-up.sh
Created November 28, 2019 01:39
Clean up node_modules directory
# Show all node_modules folder information in current working directory
alias show-all-node-modules="find . -name 'node_modules' -type d -prune -print | xargs du -chs"
# Remove all node_modules folder in current working directory
alias remove-all-node-modules="show-all-node-modules && find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;"
@vreality64
vreality64 / caution.md
Last active October 21, 2021 15:58
GraphQL ์ฃผ์˜์‚ฌํ•ญ

DB ์Šคํ‚ค๋งˆ์™€ GraphQL Type ๊ณผ์˜ ์—ฐ๊ด€์„ฑ

๊ฒฐ๋ก ๋ถ€ํ„ฐ ๋งํ•˜์ž๋ฉด, ์ „ํ˜€ ์—†๋‹ค.

DB ์Šคํ‚ค๋งˆ๋กœ๋ถ€ํ„ฐ GraphQL Type ์„ ์ž๋™์œผ๋กœ ๋งŒ๋“ค์–ด ๋‚ผ ์ˆ˜๋Š” ์žˆ๋‹ค. ์ด๋Š” GraphQL Type ์„ ์ž‘์„ฑํ•˜๋Š” ๋…ธ๋ ฅ์„ ์ค„์ด๊ณ , ํ•˜๋‚˜์˜ ์Šคํ‚ค๋งˆ๋กœ๋ถ€ํ„ฐ ๋™์ผํ•œ ๊ฐœ๋…์„ ์ƒ์„ฑํ•˜๊ฒ ๋‹ค๋Š”๋ฐ ๋ชฉ์ ์ด ์žˆ๋‹ค.

๊ทธ๋Ÿฐ๋ฐ ์ž˜ ์ƒ๊ฐํ•ด๋ณด์ž. ์ด๊ฒŒ ์˜ณ์€ ๊ฒƒ์ธ๊ฐ€?

์„œ๋ฒ„์—์„œ DB ์Šคํ‚ค๋งˆ๋ฅผ ๋ณ€ํ™˜ํ•œ ๋‚ด์šฉ์œผ๋กœ, Query ๋ฅผ ์ •์˜ํ•ด API ์—”๋“œํฌ์ธํŠธ๋ฅผ ์—ด์–ด๋‘์—ˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ด๋ณด์ž.

JSX Spread Attributes

If you know all the properties that you want to place on a component a head of time, it is easy to use JSX:

  var component = <Component foo={x} bar={y} />;

Mutating Props is Bad, mkay

@vreality64
vreality64 / const-enum.ts
Last active June 1, 2018 09:37
Typescript const enum vs enum ([email protected])
// Declare
const enum CommandType {
FOO = 1,
BAR = 2
};
// Usage
const commandType = CommandType.FOO
// Transpiled (inlining)
@vreality64
vreality64 / jekyll-and-liquid.md
Last active August 5, 2017 15:51 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@vreality64
vreality64 / .bash_profile
Created May 4, 2017 08:28
์˜ˆ์œ ๊นƒ
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
var instance = new Hello();
instance.on("test", {
somethig: function () {
this.fireEvent("next", this.name);
},
name: "world"
});
// fireEvent ๋Š” instance ์˜ ํ•จ์ˆ˜๋‹ค.
@vreality64
vreality64 / graduation-report.md
Last active April 21, 2024 13:39
์ค‘์•™๋Œ€ํ•™๊ต ์ปดํ“จํ„ฐ๊ณตํ•™๋ถ€ ํ•™์‚ฌ ์กธ์—…๋…ผ๋ฌธ - ๋ฐ•์„ฑํ˜„

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ •์  ๋ถ„์„์˜ ํ•œ๊ณ„์™€ ๋ฐœ์ „ ๋ฐฉํ–ฅ

keyword: ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ, ์ •์  ๋ถ„์„, ๋™์  ์–ธ์–ด, ์ฝ”๋“œ ์ตœ์ ํ™”

์„œ๋ก 

1995๋…„ ๋‹น์‹œ๋Š” ์ปดํ“จํ„ฐ ๋ฆฌ์†Œ์Šค๊ฐ€ ๋น„์ŒŒ์„ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๋„คํŠธ์›Œํฌ ์ธํ”„๋ผ์˜ ๋‚ฎ์€ ๋Œ€์—ญํญ ๋“ฑ ๋‹ค์–‘ํ•œ ๋ฌธ์ œ๋“ค๋กœ ์ธํ•˜์—ฌ ๋Œ€๋ถ€๋ถ„์˜ ์ž‘์—…์„ ์„œ๋ฒ„์—์„œ ์ฒ˜๋ฆฌํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‹ค ์ปดํ“จํ„ฐ ๋ฆฌ์†Œ์Šค์˜ ๋น„์šฉ์ด ๋‚ฎ์•„์ง€๋ฉด์„œ ์›น ๋ธŒ๋ผ์šฐ์ €์—์„œ ์ž…๋ ฅ ๊ฒ€์ฆ์ฒ˜๋Ÿผ ์ž‘์€ ์ž‘์—…๋“ค์„ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜๋ฉด์„œ, ํ•ด๋‹น ์ž‘์—…๋“ค์„ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๊ฐ€ ๋“ฑ์žฅํ–ˆ์Šต๋‹ˆ๋‹ค.

@vreality64
vreality64 / recognized.js
Created August 15, 2015 05:05
AngularJS and scope.$apply example
function Ctrl($scope) {
$scope.message = "Waiting 2000ms for update";
setTimeout(function () {
$scope.$apply(function () { // wrapping using $scope.$apply
$scope.message = "Timeout called!";
});
}, 2000);
}
@vreality64
vreality64 / not_recognized.js
Last active August 29, 2015 14:27
AngularJS and scope.$apply example
function Ctrl($scope) {
$scope.message = "Waiting 2000ms for update";
setTimeout(function () {
$scope.message = "Timeout called!";
// AngularJS unaware of update to $scope
}, 2000);
}