Skip to content

Instantly share code, notes, and snippets.

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

Dong-Ho Choi yungblud

๐Ÿ„โ€โ™‚๏ธ
View GitHub Profile
@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

@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,

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 / image_picker_source_code.swift
Last active April 12, 2021 06:56
image picker source code swift
func launchLibrary() -> Void {
guard let callback = self.globalCallback else { return }
let fetchOptions = PHFetchOptions()
fetchOptions.includeAssetSourceTypes = .typeUserLibrary
fetchOptions.sortDescriptors = [.init(key: "creationDate", ascending: false)]
self.fetchedAssets = PHAsset.fetchAssets(with: .image, options: fetchOptions)
self.imageShowerViewController = ImageShowerViewController(fetchedAssets: self.fetchedAssets, options: self.options, callback: callback)
guard let imageShowerViewController = self.imageShowerViewController else { return }
PHPhotoLibrary.shared().register(self)
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)

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

  • 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 ์— ๋“ค์–ด๊ฐ€์„œ ์ธ์Šคํ†จ๋Ÿฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„ค์น˜ํ•˜์„ธ์š”.

@yungblud
yungblud / react-typescript-absolute.md
Created March 4, 2020 02:50
๋ฆฌ์•กํŠธ, ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ํ”„๋กœ์ ํŠธ์˜ ์ ˆ๋Œ€๊ฒฝ๋กœ ์ž„ํฌํŠธ
  1. tsconfig

tsconfig.json ์ชฝ์— baseUrl ์†์„ฑ์ด ๋“ค์–ด๊ฐ€์•ผ ํ•œ๋‹ค.

  "complilerOptions": {
    ...
    "baseUrl": ".",
    ...
 },
yarn add @loadable/component
yarn add --dev @types/loadable__component
@yungblud
yungblud / 1.react-pwa-from-webpack.md
Last active April 23, 2023 01:10
๋ฆฌ์•กํŠธ ํ”„๋กœ์ ํŠธ๋ฅผ ์›นํŒฉ์œผ๋กœ ๋งŒ๋“ค์–ด๋ณด๊ธฐ.
  1. ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ๋ฐ ๊นƒ ์ €์žฅ์†Œ master ํ‘ธ์‹œ.
mkdir react-webpack
yarn init -y
git init

https://gitignore.io ๋กœ .gitignore ์ƒ์„ฑ .gitignore

@yungblud
yungblud / CRA register serviceworker.md
Created December 21, 2019 05:34
CRA register serviceworker

๊ธฐ๋ณธ์ ์œผ๋กœ production์—์„œ๋งŒ service worker๊ฐ€ ๋™์ž‘ํ•˜๊ฒŒ ๋˜์žˆ์Œ.

index.js

serviceWorker.register();