Skip to content

Instantly share code, notes, and snippets.

View yungblud's full-sized avatar
๐Ÿ„โ€โ™‚๏ธ

Dong-Ho Choi yungblud

๐Ÿ„โ€โ™‚๏ธ
View GitHub Profile
@yungblud
yungblud / login-with-github.md
Created June 6, 2019 14:05 — forked from ninanung/login-with-github.md
Github๋กœ ๋กœ๊ทธ์ธํ•˜๊ธฐ!

Github๋กœ ๋กœ๊ทธ์ธํ•˜๊ธฐ feat.Vue and Node.js

1. Github๋กœ ๋กœ๊ทธ์ธํ•˜๊ธฐ?

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

2. ๋ชฉํ‘œ

๋ชฉํ‘œ
์œ„์™€ ๊ฐ™์ด ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด Github์—์„œ ์ธ์ฆ์„ ์‹คํ–‰ํ•˜๊ณ  ๊ด€๋ จ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ›์•„์˜ค๋Š” ๋™์ž‘์„ ๊ตฌํ˜„ํ•ด ๋ณผ ๊ฒƒ์ด๋‹ค.

@yungblud
yungblud / download-file.js
Created July 10, 2019 09:09 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);

์„ค์น˜ ํ•  ํ•ญ๋ชฉ

  • Node.js : ๋ฆฌ์•กํŠธ ํ”„๋กœ์ ํŠธ๋ฅผ ์ค€๋น„ํ•˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•œ webpack, babel ๋“ฑ์˜ ๋„๊ตฌ๋“ค์„ ์‹คํ–‰ํ•˜๋Š”๋ฐ์— ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.
  • Yarn : ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ํŒจํ‚ค์ง€๋ฅผ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด์„œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. Node.js ๋ฅผ ์„ค์น˜ํ•˜๋ฉด npm ์ด ์„ค์น˜๋˜์–ด์„œ npm ์œผ๋กœ ํ•ด๋„ ๋˜๊ธด ํ•˜์ง€๋งŒ, yarn์„ ์‚ฌ์šฉํ•˜๋ฉด ํ›จ์”ฌ ๋น ๋ฆ…๋‹ˆ๋‹ค.
  • Code Editor (VS Code, Atom, ...) : ์ฝ”๋“œ ์—๋””ํ„ฐ๋Š” ์—ฌ๋Ÿฌ๋ถ„์ด ์ข‹์•„ํ•˜๋Š”๊ฑธ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ €๋Š” VS Code ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ•์˜๋ฅผ ์ง„ํ–‰ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

Windows

Node.js

https://nodejs.org/ko/ ์— ๋“ค์–ด๊ฐ€์„œ ์ขŒ์ธก LTS ๋ฒ„์ „์„ ์„ค์น˜ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค

Yarn

https://yarnpkg.com/en/docs/install#windows-tab ์— ๋“ค์–ด๊ฐ€์„œ ์ธ์Šคํ†จ๋Ÿฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„ค์น˜ํ•˜์„ธ์š”.

Install libimobiledevice on Mac OS X
So you'd like to manage your iOS devices by command line?
You can use libimobiledevice tools for that.
Easy on Linux. Let's see how it is on Mac OS X.
You'll need to:
1. install Xcode
2. start Xcode and agree to it's license
3. install Xcode command line tools (Start Xcode, Go to Preferences -> Downloads tab)
4. install homebrew by this command (sudo password will be prompted)

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@yungblud
yungblud / craco.config.js
Created March 3, 2022 03:49 — forked from PhilippMolitor/craco.config.js
Fix including yarn workspaces packages in create-react-app with craco
module.exports = {
webpack: {
configure: (webpackConfig) => ({
...webpackConfig,
module: {
...webpackConfig.module,
rules: webpackConfig.module.rules.map((rule) => {
if (!rule.oneOf) return rule;
return {
...rule,
@yungblud
yungblud / 00-README-NEXT-SPA.md
Created March 19, 2023 03:07 — forked from gaearon/00-README-NEXT-SPA.md
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Building