Skip to content

Instantly share code, notes, and snippets.

@JaeYeopHan
JaeYeopHan / what-forces-layout.md
Created March 21, 2017 06:15 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@JaeYeopHan
JaeYeopHan / debug.log
Created March 30, 2017 01:46
Enter `webpack -d` command
ERROR in ./~/websocket/package.json
Module parse failed: /Users/Naver/dev/mapia/2017-01-HUDI-MAC-CHAR/WEB-MAC-CHAR/node_modules/websocket/package.json Unexpected token (2:9)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (2:9)
at Parser.pp$4.raise (/Users/Naver/dev/mapia/2017-01-HUDI-MAC-CHAR/WEB-MAC-CHAR/node_modules/webpack/node_modules/acorn/dist/acorn.js:2221:15)
at Parser.pp.unexpected (/Users/Naver/dev/mapia/2017-01-HUDI-MAC-CHAR/WEB-MAC-CHAR/node_modules/webpack/node_modules/acorn/dist/acorn.js:603:10)
at Parser.pp.semicolon (/Users/Naver/dev/mapia/2017-01-HUDI-MAC-CHAR/WEB-MAC-CHAR/node_modules/webpack/node_modules/acorn/dist/acorn.js:581:61)
at Parser.pp$1.parseExpressionStatement (/Users/Naver/dev/mapia/2017-01-HUDI-MAC-CHAR/WEB-MAC-CHAR/node_modules/webpack/node_modules/acorn/dist/acorn.js:966:10)
at Parser.pp$1.parseStatement (/Users/Naver/dev/mapia/2017-01-HUDI-MAC-CHAR/WEB-MAC-CHAR/node_modules/webpack/node_modules/acorn/dist/acorn.
@JaeYeopHan
JaeYeopHan / kr_won_to_backquote.sh
Created May 4, 2017 06:29 — forked from redism/kr_won_to_backquote.sh
macOS Sierra에서 원화(₩) 대신 백 쿼트(`) 입력하기
#!/bin/bash
if [ -f ~/Library/KeyBindings/DefaultkeyBinding.dict ]; then
echo "~/Library/KeyBindings/DefaultkeyBinding.dict already exists"
exit -1
fi
mkdir -p ~/Library/KeyBindings
cat << EOF > ~/Library/KeyBindings/DefaultkeyBinding.dict
{
"₩" = ("insertText:", "\`");
@JaeYeopHan
JaeYeopHan / react_component_template.js
Last active May 5, 2017 11:50
React live template
import React, { Component } from 'react';
import PropTypes from 'prop-types';
const propTypes = {
};
const defaultProps = {
};
@JaeYeopHan
JaeYeopHan / .editorconfig
Created May 5, 2017 12:19
Editor config file
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
@JaeYeopHan
JaeYeopHan / .gitconfig
Last active September 25, 2017 07:18
Git command alias
[user]
name = JaeYeopHan
email = ljyhanll@gmail.com
[color]
status = auto
branch = auto
diff = auto
ui = auto
@JaeYeopHan
JaeYeopHan / live_template_rsc.js
Created May 9, 2017 12:32
react_functional_component template [rsc]
import React from 'react';
const componentName = () => {
return (
<div>
</div>
);
};
export default componentName;
@JaeYeopHan
JaeYeopHan / index.js
Created May 10, 2017 10:09
setting redux devtool
import React from 'react';
import ReactDOM from 'react-dom';
import App from './containers/App';
import './index.css';
import {createStore} from 'redux';
import reducers from './reducers';
import {Provider} from 'react-redux';
const store = createStore(reducers, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());
@JaeYeopHan
JaeYeopHan / test_template.java
Last active May 30, 2017 01:26
JUnit template
@Test
public void test() {
assertThat(testFunction(), is(""));
}
public String testFunction() {
return "";
}
@JaeYeopHan
JaeYeopHan / .eslintrc.js
Created June 2, 2017 01:25 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {