Skip to content

Instantly share code, notes, and snippets.

View dohoons's full-sized avatar

dohoons dohoons

View GitHub Profile
@dohoons
dohoons / gulpfile.js
Last active May 11, 2018 01:34
multi depth img sprite
var gulp = require('gulp'),
path = require('path'),
merge = require('merge-stream'),
listFilepaths = require('list-filepaths'),
spritesmith = require('gulp.spritesmith-multi');
// 자동 스프라이트
gulp.task('auto-sprite', function() {
var stream = merge();
/* jQuery ui-datepicker extension */
/**
*
* https://gist.github.com/Artemeey/8bacd37964a8069a2eeee8c9b0bd2e44/
*
* Version: 1.0 (15.06.2016)
* Requires: jQuery v1.8+
* Requires: jQuery-UI v1.10+
*
// scroll check
(function() {
var $window = $(window);
var $target = $('.scroll-check');
function scrollHandle() {
var winHeight = $window.height();
var scrollTop = $window.scrollTop();
$target.each(function() {
import React from 'react'
import { func, node, number, object, shape, string } from 'prop-types'
import { withRouter } from 'react-router-dom'
const debounce = (fn, time) => {
let timeout;
return function() {
const functionCall = () => fn.apply(this, arguments)
{
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-double-quotes": true,
"attr-value-not-empty": false,
"attr-no-duplication": true,
"doctype-first": true,
"tag-pair": true,
"tag-self-close": false,
"spec-char-escape": false,
@dohoons
dohoons / getBeautyWeight.js
Created June 24, 2020 13:50
getBeautyWeight
function getBeautyWeight(height, sex = 'men') {
const standardHeight = {
men: 175,
female: 163,
};
const standardRatio = {
men: 62.7 / standardHeight.men,
female: 49.2 / standardHeight.female,
};
const standardWeight = {
@dohoons
dohoons / ScrollPositionProvider.tsx
Last active July 30, 2020 04:52 — forked from schmidsi/ScrollPositionProvider.tsx
Scribble to fix scroll position
import React, { useEffect, useContext } from 'react';
import Router from 'next/router';
export const ScrollPositionContext = React.createContext({
triggerScroll: () => null,
});
export const useScrollPosition = () => useContext(ScrollPositionContext);
let routerBound = false;