Skip to content

Instantly share code, notes, and snippets.

View eunsukimme's full-sized avatar
๐ŸŽฏ
Focusing

Eunsu(Evan) Kim eunsukimme

๐ŸŽฏ
Focusing
View GitHub Profile
@saqueib
saqueib / errorHandler.js
Last active June 9, 2022 06:42
Global error handling using axios interceptor for http calls http://www.qcode.in/api-error-handling-in-vue-with-axios
import axios from 'axios'
import toast from './toast'
function errorResponseHandler(error) {
// check for errorHandle config
if( error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false ) {
return Promise.reject(error);
}
// if has response show the error
@faressoft
faressoft / dom_performance_reflow_repaint.md
Last active May 8, 2025 01:33
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
@novascreen
novascreen / README.md
Last active November 18, 2021 08:11
How to mock next/router in Storybook

If you use Storybook with Next.js and have components using next/link you'll have to mock next/router the same you would for testing with Jest or others. Simply create a file with the mock router as shown below and import it in your Storybook config.

This is based on some information from an issue on Next.js:

vercel/next.js#1827

@WebReflection
WebReflection / todo.js
Last active April 11, 2025 10:31
Web Components, the React way, without Shadow DOM
// https://medium.com/@bdc/web-components-the-react-way-8ed5b6f4f942
const store = (() => {
let state;
return todos => {
if (todos) {
state = todos;
render("todo-list");
}
return state;
};
@dingzeyuli
dingzeyuli / check_github_repo_size
Created December 16, 2016 22:34
Check the size of a github repo before downloading
# http://webapps.stackexchange.com/questions/39587/view-estimated-size-of-github-repository-before-cloning
# tested on macOS
echo https://github.com/torvalds/linux.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size
# output:
# "size": 1746294,
@serithemage
serithemage / AWSCertifiedDeveloperUnofficialStudyGuide.md
Last active January 14, 2025 02:29
AWS ๊ณต์ธ ๊ฐœ๋ฐœ์ž - ์–ด์†Œ์‹œ์—์ดํŠธ ์ˆ˜ํ—˜ ๊ฐ€์ด๋“œ

AWS ํ•™์Šต ๋งํฌ์ง‘ ์‹œ๋ฆฌ์ฆˆ

  • AWS ํ•™์Šต ์ž๋ฃŒ์ง‘ http://bit.ly/aws-study-resource
  • AWS ๊ณต์ธ ์†”๋ฃจ์…˜์Šค ์•„ํ‚คํ…ํŠธ - ์–ด์†Œ์‹œ์—์ดํŠธ ์ˆ˜ํ—˜ ๊ฐ€์ด๋“œ http://bit.ly/sacertguide
  • AWS ๊ณต์ธ ๊ฐœ๋ฐœ์ž - ์–ด์†Œ์‹œ์—์ดํŠธ ์ˆ˜ํ—˜ ๊ฐ€์ด๋“œ http://bit.ly/devcertguide
  • AWS ๋ณด์•ˆ ๊ด€๋ จ ์ปจํ…์ธ  ๋ชจ์Œ์ง‘ http://bit.ly/seccontents

AWS ๊ณต์ธ ๊ฐœ๋ฐœ์ž - ์–ด์†Œ์‹œ์—์ดํŠธ ์ˆ˜ํ—˜ ๊ฐ€์ด๋“œ(http://bit.ly/devcertguide)

@gaearon
gaearon / connect.js
Last active May 3, 2025 05:27
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@CMCDragonkai
CMCDragonkai / building_a_nix_package_c&c++.md
Last active April 8, 2024 16:38
Building a Nix Package (The C&C++ Version)

Building a Nix Package (The C&C++ Version)

Nix can be used to build any kind of package. But here I'm just going to focus on the simple C&C++ case.

Firstly we have to know that the final built packages will located inside /nix/store. Which is globally readable directory of all build inputs and build outputs of the Nix system. The emphasis is on readable, not writable, that is /nix/store is meant to be modified by the user or programs except for the Nix system utilities. This centralises the management of packages, and keeps our packages and package configuration consistent.

So what exactly are we trying to build. Our goal is to build a directory that will be located in /nix/store/*-package-version/, where * is the hash of the package. Preferably a version is also available, but some C&C++ packages don't have versions, so in that case, there's only /nix/store/*-package/.

What will be inside this directory? It follows the GNU Coding Standards descri

@d2s
d2s / installing-node-with-nvm.md
Last active April 24, 2025 18:50
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.
@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]