Skip to content

Instantly share code, notes, and snippets.

View happydeveloper's full-sized avatar
๐ŸŽฏ
Focusing

DU RU KANG happydeveloper

๐ŸŽฏ
Focusing
  • duru
  • seoul, korea
View GitHub Profile
@happydeveloper
happydeveloper / jumin.js
Created February 16, 2016 04:33 — forked from composite/jumin.js
์ฃผ๋ฏผ๋“ฑ๋ก๋ฒˆํ˜ธ ์ƒ์„ฑ๊ธฐ (์ฃผ๋ฏผ๋ฒˆํ˜ธ ๋กœ์ง ๋“ค์–ด๊ฐ€๋Š” ์–‘์‹ ํ…Œ์ŠคํŠธ์šฉ. ๊ฐœ๋ฐœ ์™ธ ๋ชฉ์  ์‚ฌ์šฉ ๊ธˆ์ง€, ์ด ํ”„๋กœ๊ทธ๋žจ ์‚ฌ์šฉ์— ๋Œ€ํ•œ ๋ฒ•์  ์ฑ…์ž„ ์ผ์ฒด ์—†์Œ.)
/**
* ์ฃผ๋ฏผ๋ฒˆํ˜ธ ์ƒ์„ฑ๊ธฐ
* ์‚ฌ์šฉ์˜ˆ) jumin()
* jumin({year:1990, month:3, day: 12, loop: 10}); //1990๋…„ 3์›” 12์ผ์ƒ 10๊ฐœ ์ฃผ๋ฏผ๋ฒˆํ˜ธ ์ƒ์„ฑ.
* ํ™•์ธ์˜ˆ) jumin.verify(ํ™•์ธํ•  ์ฃผ๋ฏผ๋ฒˆํ˜ธ) ํ™•์ธํ•  ์ฃผ๋ฏผ๋ฒˆํ˜ธ๋Š” - ์žˆ์–ด๋„ ์—†์–ด๋„ ๋ฌด๊ด€. 13์ž๋ฆฌ๋งŒ ๋งž์ถ”๋ฉด ๋จ.
* @param {object} options ์˜ต์…˜
* year: ๋…„๋„, ๋นˆ ๊ฐ’์œผ๋ฉด ๋žœ๋ค
* month: ์›”, ๋นˆ ๊ฐ’์ด๋ฉด ๋žœ๋ค
* day: ์ผ, ๋นˆ ๊ฐ’์ด๋ฉด ๋žœ๋ค
* loop: ์ƒ์„ฑ๊ฐœ์ˆ˜, ๋นˆ ๊ฐ’์ด๋ฉด 1๊ฐœ ์ƒ์„ฑ.
@happydeveloper
happydeveloper / meeting_like_lightning.txt
Last active November 30, 2015 00:33
Meeting like Lightning.
๋ฒ™๊ฐœ
๊ฐ‘์ž๊ธฐ ๋ชจ์ด๋Š” ๋ชจ์ž„
์‚ฌ๋žŒ๋“ค์„ ๋งŒ๋‚œ๋‹ค๋Š” ๊ฒƒ๊ณผ ๋Œ€ํ™”๋ฅผ ๋‚˜๋ˆˆ๋‹ค๋Š” ๊ฒƒ
๋งŒ๋‚˜๋ฉด ์ข‹์€
์˜ํ™”
@happydeveloper
happydeveloper / the_camino_de_santiago.txt
Created November 28, 2015 07:57
์ˆ ๋ก€์ž๊ธธ - The Camino de Santiago
์ˆ ๋ก€์ž๊ธธ
์ˆ ๋ก€์ž๊ธธ์„ ๋‹ค๋…€์˜จ์ง€ ๊ฝค ์˜ค๋žœ ์‹œ๊ฐ„์ด ์ง€๋‚ฌ๋‹ค.
๊ทธ๋ฆฌ๊ณ  ์˜ค๋Š˜ ๊ทธ ์ˆ ๋ก€์ž๊ธธ์—์„œ ๋งŒ๋‚œ ์‚ฌ๋žŒ๋“คํ•œํ…Œ ์˜์ƒ ํ•˜๋‚˜๊ฐ€ ์นœ๊ตฌ์˜ ์ง‘์œผ๋กœ ๋ฐฐ๋‹ฌ๋˜์—ˆ๋‹ค.
๊ทธ ๊ธธ์—์„œ ๋งŒ๋‚ฌ๋˜ ์‚ฌ๋žŒ๋“ค์ด ์ธํ„ฐ๋ทฐ ๋‚ด์šฉ์„ ์—ฎ์€ ๋‹คํ๋ฉ˜ํ„ฐ๋ฆฌ์˜€๋‹ค.
์‚ฌ๋žŒ์€ ์†Œ์ค‘ํ•˜๊ณ  ์ข‹์€ ๊ธฐ์–ต๋“ค์€ ๊ธˆ๋ฐฉ ์žƒ์–ด๋ฒ„๋ฆฌ๋Š” ๊ฒƒ ๊ฐ™๋‹ค.
์Šค์œ„์Šค์—์„œ ์˜จ ๋‹คํ๋ฉ˜ํ„ฐ๋ฆฌ๋ฅผ ์‹œ์ฒญํ•˜๋ฉด์„œ ์šฐ๋ฆฌ๋Š” ๊ทธ๋•Œ์˜ ์ข‹์€ ๊ธฐ์–ต์„ ๋‹ค์‹œ ์ƒ๊ธฐํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค.
@happydeveloper
happydeveloper / the_first_snow.txt
Created November 28, 2015 07:21
the_first_snow.txt
์ฒซ๋ˆˆ
์˜ฌ ๊ฒจ์šธ๋“ค์–ด ์„œ์šธ์— ์ฒซ๋ˆˆ์ด ์™”๋‹ค.
์˜ˆ๋ฆฌ๊ณ  ์Œ€์Œ€ํ•œ ๋ฐ”๋žŒ๊ณผ ํ•จ๊ป˜
This is a method to using your Ubuntu 12.04 server without the Unity desktop on a very fast remote desktop program. This is by far the best method to managing your Ubuntu server if you like GUI.
apt-get install --no-install-recommends ubuntu-desktop
apt-get --yes purge unity unity-2d unity-2d-places unity-2d-panel unity-2d-spread
apt-get --yes purge unity-asset-pool unity-services unity-lens-* unity-scope-*
apt-get --yes purge liboverlay-scrollbar*
apt-get --yes purge appmenu-gtk appmenu-gtk3 appmenu-qt
apt-get --yes purge firefox-globalmenu thunderbird-globalmenu
apt-get --yes purge unity-2d-common unity-common
apt-get --yes purge libunity-misc4 libunity-core-5*
wordsChunk = document.getElementsByTagName('body')[0].innerText.split(' ')
wordSortTable = {};
for(i = 0; i < wordsChunk.length; i++){
wordSortTable[wordsChunk[i]] = wordSortTable[wordsChunk[i]] == undefined ? 1 : wordSortTable[wordsChunk[i]]+1;
}
wordSort = []
for(var name in wordSortTable){
if(name.length == 1 && name.match(/\W/g))
continue;
wordSort.push([name, wordSortTable[name]]);
@happydeveloper
happydeveloper / gist:dca3f7dd199ca66f46fb
Created August 14, 2014 03:00 — forked from egoing/gist:11163965
Youtube์—์„œ ์žฌ์ƒ๋ชฉ๋ก์˜ ์ด์žฌ์ƒ์‹œ๊ฐ„์„ ์•Œ์•„๋‚ด๋Š” ์Šคํฌ๋ฆฝํŠธ
var list = document.getElementsByClassName('pl-video');
var len = 0;
for(var i=0; i<list.length; i++){
len += parseInt(list[i].getAttribute('data-length-in-seconds'));
}
console.log(len/60/60);
@happydeveloper
happydeveloper / seven.ino
Created June 15, 2014 06:08
๋ฆด๋ฆฌ์ฟฐ - 7์„ธ๊ทธ๋จผํŠธ ์ฝ”๋“œ
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:

#Gist๋ฅผ ์ด์šฉํ•œ ์ฝ”๋“œ์กฐ๊ฐ๊ด€๋ฆฌ ์ด๋ฒˆ ๊ธ€์—์„œ๋Š” Code Snippet์ด๋ผ ๋ถˆ๋ฆฌ๋Š” ์ฝ”๋“œ์กฐ๊ฐ์„ ํšจ๊ณผ์ ์œผ๋กœ ์–ด๋–ป๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์„๊นŒ์— ๋Œ€ํ•œ ํ•˜๋‚˜์˜ ๋ฐฉ๋ฒ•์„ ๋…ผํ•˜๊ณ ์ž ํ•œ๋‹ค. ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•˜๋‹ค๋ณด๋ฉด ๋ฌด์ˆ˜ํžˆ ๋งŽ์€ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๊ฒŒ ๋œ๋‹ค. ๋•Œ๋•Œ๋กœ ์ž‘์„ฑํ•œ ์ฝ”๋“œ ์ค‘์˜ ์ผ๋ถ€๋ฅผ ๋‚˜์ค‘์—๋„ ํ™œ์šฉํ•ด๋ณด๊ธฐ ์œ„ํ•ด ์ฝ”๋“œ๋ฅผ ๋ถ„๋ฅ˜ํ•œ๋‹ค. ๋Œ€์ฒด๋กœ ์ด๋Ÿฐ ๊ฒฝ์šฐ ์ž์‹ ๋งŒ์˜ ๋ฉ”๋ชจ์žฅ์„ ํ™œ์šฉํ•˜๊ฑฐ๋‚˜, ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ์—๋””ํ„ฐ๋ฅผ ํ™œ์šฉํ•ด์„œ ์ด๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒฝํ–ฅ์ด ์žˆ๋‹ค. ํ•˜์ง€๋งŒ ์ด๋Ÿฐ ๋ฐฉ๋ฒ•์€ ์ฝ”๋“œ๊ฐ€ ๋งŽ์•„์งˆ์ˆ˜๋ก ๊ฒ€์ƒ‰ํ•˜๊ธฐ๊ฐ€ ์‰ฝ์ง€ ์•Š๊ณ , ๊ฐœ๋ฐœ์–ธ์–ด์— ๋”ฐ๋ผ ํšจ์œจ์ ์œผ๋กœ ์ฝ”๋“œ๋ฅผ ๊ด€๋ฆฌํ•˜๊ธฐ๋„ ์–ด๋ ต๋‹ค. ๋˜ํ•œ ๊ฐœ๋ฐœํ•˜๋Š” IDEํ™˜๊ฒฝ์—์„œ๋„ ์†์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ์‚ฌ๋ฌด์‹ค/์ง‘ ๋“ฑ, ์—ฌ๋Ÿฌ ์žฅ์†Œ์—์„œ ๋™์ผํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๋„ ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค. (๋ฌผ๋ก  Dropbox)์™€ ๊ฐ™์€ ํด๋ผ์šฐ๋“œ ์„œ๋น„์Šค๋ฅผ ํ™œ์šฉํ•˜๋ฉด ์–ด๋А์ •๋„ ๋‹ค์–‘ํ•œ ํ™˜๊ฒฝ์—์„œ ํ™œ์šฉ๊ฐ€๋Šฅํ•˜์ง€๋งŒ ์ด ๋ฐฉ๋ฒ•์€ ํšŒ์‚ฌ์™€ ๊ฐ™์ด ๋ณด์•ˆ ์ƒ์˜ ์ด์œ ๋กœ ์„œ๋น„์Šค๊ฐ€ ๋ง‰ํ˜€ ์žˆ๋Š” ๊ณณ์—์„œ๋Š” ์ œ๋Œ€๋กœ ์ ์šฉ์ด ๋ถˆ๊ฐ€๋Šฅํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.

๋งŽ์€ ์›น์‚ฌ์ดํŠธ ์กฐ์‚ฌ๋ฅผ ํ†ตํ•ด ๋‹ค์–‘ํ•œ Snippet๊ด€๋ฆฌ ์„œ๋น„์Šค๋ฅผ ์ฐพ์•„๋ดค์ง€๋งŒ, ๊ทธ ์ค‘์—์„œ ๊ฐœ๋ฐœ์— ๊ฐ€์žฅ ์œ ์šฉํ•œ ๋ฐฉ์‹์€ GitHub์—์„œ ์ œ๊ณตํ•˜๋Š” Gist๋ผ๋Š” ์„œ๋น„์Šค๋ฅผ ์ด์šฉํ•˜๋Š” ๊ฒƒ์ด์—ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋ณธ ์„ธ์…˜์—์„œ๋Š” Gist๋ฅผ ์ด์šฉํ•œ Snippet๊ด€๋ฆฌ ๋ฐฉ์‹์„ ์•Œ์•„๋ณด๊ณ ์ž ํ•œ๋‹ค. ๋˜ํ•œ ์ตœ๊ทผ ๊ฐ๊ด‘๋ฐ›๊ณ  ์žˆ๋Š” Sublime Text์—์„œ Gistํ”Œ๋Ÿฌ๊ทธ์ธ์„ ํ™œ์šฉํ•˜์—ฌ ์–ด๋–ป๊ฒŒ ํšจ์œจ์ ์œผ๋กœ ๊ฐœ๋ฐœEditor์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š”์ง€๋„ ์•Œ์•„๋ณด๊ณ ์ž ํ•œ๋‹ค.

#Gistํ™˜๊ฒฝ ์…‹ํŒ…

Github ํšŒ์›๊ฐ€์ž…

Gist ์‚ฌ์šฉ์„ ์œ„ํ•ด์„œ๋Š” GitHub ํšŒ์›๊ฐ€์ž…์„ ํ•œ๋‹ค. Github๋Š” ๋งค์šฐ ์œ ๋ช…ํ•˜๊ณ  ๋„๋ฆฌ ํผ์ ธ์žˆ๋Š” ์„œ๋น„์Šค์ด๋ฏ€๋กœ ์„œ๋น„์Šค๊ฐ€ ์ค‘๋‹จ๋  ๊ฑฑ์ •์„ ํ•˜์ง€ ์•Š๊ณ  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ์™ธ๊ตญ์‚ฌ์ดํŠธ์ด๋‹ˆ๋งŒํผ ํšŒ์›์ •๋ณด๋„ ๊ณผ๋„ํ•˜๊ฒŒ ์š”๊ตฌํ•˜์ง€ ์•Š๋Š”๋‹ค.

Sublime์— Gist ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค์น˜

#ํ…Œ์ด๋ธ” ์ƒ์„ฑ
CREATE TABLE `student` (
`id` tinyint NOT NULL ,
`name` char(4) NOT NULL ,
`sex` enum('๋‚จ์ž','์—ฌ์ž') NOT NULL ,
`address` varchar(50) NOT NULL ,
`birthday` datetime NOT NULL ,
PRIMARY KEY (`id`)
);