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,
/**
* 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 checkPersonalNumber(jumin) {
jumin = String(jumin);
if(jumin.length !== 13) {
return false;
}
var sum = 0;
var j = 2;
var queryToObject = function(queryString) {
var query = queryString || location.search.replace(/\?/, "");
return query.split("&").reduce(function(obj, item, i) {
if(item) {
item = item.split('=');
obj[item[0]] = item[1];
return obj;
}
}, {});
};
<input type="number" id="zip">
<button type="button" onClick="search_addr();">住所検索</button>
<input type="text" id="address">
<!-- 스크립트를 로드 -->
<script src="//api.zipaddress.net/sdk/zipaddr.min.js" async></script>
<script>
var search_addr = function(){
var $zip = $('#zip');
var zip = $zip.val();