This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let elemA = document.getElementsByTagName('a'); | |
let body = document.getElementsByTagName('body')[0]; | |
console.log('[한번에 appendChild 해주는 경우 with fragment]') | |
console.time('testDocumentFragment'); | |
fragment = document.createDocumentFragment(); | |
for(var i = 0; i < elemA.length * 100; i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { throttle } from 'lodash-es' | |
import './index.scss' | |
export class ProgressBar extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
scrollY: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------------------- // | |
// Style of Utilities | |
// ------------------------------------- // | |
:global(.blind) { | |
font-size: 0; | |
height: 0; | |
left: 0; | |
line-height: 0; | |
overflow: hidden; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
externals: [ | |
function(context, request, callback) { | |
if ((/packages\/[^\/]+\//g).test(context)){ | |
if (!/^\./g.test(request)) { | |
console.log("exclude", request); | |
return callback(null, 'commonjs ' + request); | |
} | |
} | |
callback(); | |
}], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ZSH=/Users/user/.oh-my-zsh | |
ZSH_THEME="powerlevel9k/powerlevel9k" | |
# ZSH_THEME="bullet-train" | |
# ZSH_THEME="agnosterzak" | |
# ZSH_THEME="agnoster" | |
# Add wisely, as too many plugins slow down shell startup. | |
plugins=(git) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Represents the completion of an asynchronous operation | |
*/ | |
interface Promise<T> { | |
/** | |
* Attaches callbacks for the resolution and/or rejection of the Promise. | |
* @param onfulfilled The callback to execute when the Promise is resolved. | |
* @param onrejected The callback to execute when the Promise is rejected. | |
* @returns A Promise for the completion of which ever callback is executed. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const counter = (state = 0, action) => { | |
switch (action.type) { | |
case 'INCREMENT': | |
return state + 1; | |
case 'DECREMENT': | |
return state - 1; | |
default: | |
return state; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Card extends React.Component<CardProps> { | |
do() { | |
// do something... | |
} | |
render() { | |
const { index } = this.props; | |
return ( ... ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Marker extends EventEmitter { | |
constructor( | |
private id: number, | |
) { | |
super(); | |
document.querySelector("marker").addEventListener("click", () => { | |
// do something | |
this.trigger("card_action", this.id); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Store { | |
constructor(state = {}, actions = {}) { | |
this.state = state; | |
this.actions = actions; | |
this.dispatch = (action, data) => { | |
const newMergedData = this.actions[action](this.state, data); | |
Object.assign(this.state, newMergedData); | |
}; | |
} | |
} |
NewerOlder