Skip to content

Instantly share code, notes, and snippets.

🚚
???

Jbee JaeYeopHan

🚚
???
Block or report user

Report or block JaeYeopHan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View plugin.js
const minify = require('html-minifier').minify;
const fs = require('fs');
class HtmlMinifierPlugin {
constructor(options) {
this.options = options;
}
apply(compiler) {
compiler.plugin("emit", (compilation, callback) => {
fs.readFile(this.options.template, 'utf-8', (err, html) => {
@JaeYeopHan
JaeYeopHan / getFilterdPair.ts
Created Mar 8, 2018
Filtering object by passing checker function to util
View getFilterdPair.ts
export const getFilteredPair = (base: object, checker: (value: any) => boolean): object => {
return Object.keys(base).reduce((acc, key) => {
if (checker(key)) {
acc[key] = base[key];
}
return acc;
}, {});
}
@JaeYeopHan
JaeYeopHan / pipe.js
Created Feb 26, 2018
JavaScript functions - pipe
View pipe.js
export function pipe(...fns) {
return param => fns.reduce(
(result, fn) => fn(result),
param
)
}
@JaeYeopHan
JaeYeopHan / requiredParam.js
Created Feb 26, 2018
JavaScript code snippets - Required parameter function
View requiredParam.js
export function requiredParam (param) {
const requiredParamError = new Error(
`Required parameter, "${param}" is missing.`
)
// preserve original stack trace
if (typeof Error.captureStackTrace === ‘function’) {
Error.captureStackTrace(
requiredParamError,
requiredParam
)
@JaeYeopHan
JaeYeopHan / flatten.js
Created Feb 24, 2018
JavaScript function utils - Deep Flatten
View flatten.js
function flatten(arr) {
return function f(arr, newArr) {
arr.forEach(function(v)) {
Array.isArray(v) ? f(v, newArr) : newArr.push(v);
});
return newArr;
}(arr, []);
}
@JaeYeopHan
JaeYeopHan / .eslintrc.js
Created Jun 2, 2017 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
View test_template.java
@Test
public void test() {
assertThat(testFunction(), is(""));
}
public String testFunction() {
return "";
}
@JaeYeopHan
JaeYeopHan / index.js
Created May 10, 2017
setting redux devtool
View index.js
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 / live_template_rsc.js
Created May 9, 2017
react_functional_component template [rsc]
View live_template_rsc.js
import React from 'react';
const componentName = () => {
return (
<div>
</div>
);
};
export default componentName;
@JaeYeopHan
JaeYeopHan / .gitconfig
Last active Sep 25, 2017
Git command alias
View .gitconfig
[user]
name = JaeYeopHan
email = ljyhanll@gmail.com
[color]
status = auto
branch = auto
diff = auto
ui = auto
You can’t perform that action at this time.