Skip to content

Instantly share code, notes, and snippets.

View yungblud's full-sized avatar
🏄‍♂️

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();