Skip to content

Instantly share code, notes, and snippets.

View sunghwan2789's full-sized avatar

Sunghwan Bang sunghwan2789

View GitHub Profile
@seonghyeonkimm
seonghyeonkimm / react-18.md
Last active June 16, 2023 18:37
React 18 미리보기

즉시 사용 가능한 개선점

코드의 변경 없이 React 18로 업데이트하자마자 얻을 수 있는 개선점에 대해서 간단히 이해해보자.

  제목에서도 알 수 있는 것처럼 간단히 설명하자면, React 18 이전에는 오직 이벤트 핸들러 안에서 발생한 setState만 모아서 처리 했지만, React 18 이후부터는 promise, setTimeout 등에서 발생한 연속적인 setState도 모아서 처리될 수 있도록 개선되었다는 내용이다.

  위 기능을 피하고 싶다면 react-dom의 flushSync api를 이용하면 모아서 처리하지 않고 하나의 setState가 바로 re-render를 일으키도록 명시적으로 코드를 추가할 수 있다.

@davidfowl
davidfowl / .NET6Migration.md
Last active July 19, 2024 22:48
.NET 6 ASP.NET Core Migration
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 28, 2024 17:42
Minimal APIs at a glance
https://archive.is/llRty#selection-1131.0-1504.0
우선 국내.
1.레오폴드. http://www.leopold.co.kr/
키캡을 사면 본체를 주는 국내 최고의 키캡 판매 회사.
2. 펀키스. http://funkeys.kr/
바밀로, 더키 키보드 유통 회사. 키캡 세트도 판매 중.
기본적으로 충분한 값어치는 하는 듯.
@slikts
slikts / immer-underrated.md
Last active October 30, 2023 07:43
Appreciating the elegant simplicity of Immer

nelabs.dev

Appreciating the elegant simplicity of Immer

There is an ongoing shift in programming towards a more constrained mindset, recognizing shared mutable state and side effects as significant sources of accidental complexity and concepts like immutability and reactive, unidirectional pipelines as ways to overcome it. Simplicity is less optional than before, based on an understanding about the limited capacity of human working memory and based on programming language theory and practice. The functional programming ideas seeping into the mainstream leave less people to say that they wouldn't need them because of maybe never having used them.

The basic idea of controlling complexity through constraints is not novel at all, though, and it raises a valid question about why this shift has taken so long to develop, despite the overall trends towards automation and productivity. For example, the distincti

@SKempin
SKempin / Git Subtree basics.md
Last active June 27, 2024 07:56
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@bigonese
bigonese / vpn.sh
Created January 11, 2017 13:06
Script to start sstp-client on a Mac, connecting to Microsoft VPN, with ability to use Apple's KeyChain
#!/bin/bash
SERVICE_NAME='my-example-vpn'
SERVICE_URL='my-example-vpn.com'
if [[ ${#USER} > 1 ]]
then
read -p "Log in as ${USER}? [y/n] " LIA
else
LIA = 'n'
@briceburg
briceburg / Dockerfile.fails
Created March 30, 2016 22:17
docker - example adding www-data user to alpine images
FROM nginx:alpine
# stock verison from php:alpine image
# ensure www-data user exists
RUN set -x \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data
# 82 is the standard uid/gid for "www-data" in Alpine
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2
@jung-kim
jung-kim / map-perf.js
Last active May 25, 2023 07:01
es6 map vs array vs obj performance test
"use strict";
let looper = (callback) => {
let n = 2000000;
while (n > 0) {
callback(n);
n--;
}
}
# -*- coding: utf-8 -*-
import hashlib
import urllib2
import xml.dom.minidom as xml
ALSONG_URL = "http://lyrics.alsong.net/alsongwebservice/service1.asmx"
ALSONG_TMPL = '''\
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="ALSongWebServer/Service1Soap" xmlns:ns1="ALSongWebServer" xmlns:ns3="ALSongWebServer/Service1Soap12">
<SOAP-ENV:Body>