Skip to content

Instantly share code, notes, and snippets.

View gracefullight's full-sized avatar
👍

Eunkwang Shin gracefullight

👍
View GitHub Profile
@gracefullight
gracefullight / global-variables-are-bad.js
Last active February 17, 2021 10:06 — forked from hallettj/global-variables-are-bad.js
How and why to avoid global variables in JavaScript
// var 로 내부 변수를 선언해야합니다.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// 그렇지 않으면 전역변수로 선언됩니다.
(function() {
foo = 'Hello, world!';
print(foo) //=> Hello, world!
@gracefullight
gracefullight / cloudSettings
Created February 17, 2020 04:14
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-02-17T04:14:56.560Z","extensionVersion":"v3.4.3"}
@gracefullight
gracefullight / kubectxwin.json
Last active October 21, 2019 12:55
kubectxwin
{
"homepage": "https://github.com/thomasliddledba/kubectxwin",
"description": "Windows Version of the powerful tool kubectx.",
"license": "MIT",
"version": "0.1.1",
"architecture": {
"64bit": {
"url": "https://github.com/thomasliddledba/kubectxwin/releases/download/0.1.1/kubectxwin.exe",
"hash": "sha1:34703BCB9B16865541E58524B596B1AEC0E4E3D0"
}
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
function checkSequnceNumbers(target, counterLength= 6){
// under es6
// let sequentialCounter = Array.apply(null, Array(counterLength)).map(Number.prototype.valueOf,0);
let sequentialCounter = new Array(counterLength).fill(0);
let count = 0;
for (let i = 0, len = target.length; i < len; i++) {
let subCount = 0;
for (let j = 1; j < len; j++) {
<script type="text/javascript">
var imageModule = (function () {
'use strict';
var possible = window.File && window.FileReader && window.FormData; // html5 업로드를 지원하는지의 여부
var apiPath = '/api/test.php'; // 업로드 서버 처리 경로
var folder = '/upload/review/'; // 기본 이미지 업로드 폴더
var $input;
var maxWidth = 600;
var maxHeight = 480;
/**
* textarea를 summernote로 변경
* require ['lodash', 'axios', 'summernote', 'jQuery']
* reference: https://summernote.org/deep-dive/
*
* @param {any} target summernote를 적용할 element id || class
* @param {any} options options 기본 옵션에 merge 시킬 세부 옵션
* @returns jQuery Element
*/
var initSummernotes = function(target, options) {
<?php
// https://stackoverflow.com/questions/12807176/php-writing-a-simple-removeemoji-function
function removeEmoji($text) {
$clean_text = "";
// Match Emoticons
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
$clean_text = preg_replace($regexEmoticons, '', $text);
// Match Miscellaneous Symbols and Pictographs
@gracefullight
gracefullight / pull.sh
Last active December 27, 2017 00:35
ssh key 등록 후에도 계속 public_key가 등록이 되지 않았다고 요구할 경우 (cafe24의 경우 ssh-agent를 인식하지 못 했다)
# pull.sh
echo "=> Kill previous ssh agent"
for pid in `ps -ef | grep ssh-agent | awk '{print $2}'`;
do kill -9 $pid;
done
echo "=> Initialize ssh agent"
eval "$(ssh-agent)"
echo "=> add key"
(function($) {
$.validator.addMethod('biznum', function(bizID, element) {
var checkID = [1, 3, 7, 1, 3, 7, 1, 3, 5, 1];
var tmpBizID, i, chkSum=0, c2, remander;
bizID = bizID.replace(/-/gi, '');
for (i=0; i<=7; i++) {
chkSum += checkID[i] * bizID.charAt(i);
}
c2 = "0" + (checkID[8] * bizID.charAt(8));