Skip to content

Instantly share code, notes, and snippets.

@opklnm102
opklnm102 / file.sql
Created August 9, 2017 12:19 — forked from emmanuel/file.sql
Closure Table operations SQL fragments
-- Retrieve descendants
-- ====================
-- retrieve descendants of #4
SELECT c.*
FROM Comments AS c
JOIN TreePaths AS t ON c.comment_id = t.descendant
WHERE t.ancestor = 4;
-- Retrieve ancestors
@opklnm102
opklnm102 / gist:6e1575d7733cf7c84c756f4f6218f47e
Created May 1, 2017 07:34 — forked from ihoneymon/how-to-write-by-markdown.md
๋งˆํฌ๋‹ค์šด ์‚ฌ์šฉ๋ฒ•

[๊ณตํ†ต] ๋งˆํฌ๋‹ค์šด markdown ์ž‘์„ฑ๋ฒ•

1. ๋งˆํฌ๋‹ค์šด์— ๊ด€ํ•˜์—ฌ

1.1. ๋งˆํฌ๋‹ค์šด์ด๋ž€?

**Markdown**์€ ํ…์ŠคํŠธ ๊ธฐ๋ฐ˜์˜ ๋งˆํฌ์—…์–ธ์–ด๋กœ 2004๋…„ ์กด๊ทธ๋ฃจ๋ฒ„์— ์˜ํ•ด ๋งŒ๋“ค์–ด์กŒ์œผ๋ฉฐ ์‰ฝ๊ฒŒ ์“ฐ๊ณ  ์ฝ์„ ์ˆ˜ ์žˆ์œผ๋ฉฐ HTML๋กœ ๋ณ€ํ™˜์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ํŠน์ˆ˜๊ธฐํ˜ธ์™€ ๋ฌธ์ž๋ฅผ ์ด์šฉํ•œ ๋งค์šฐ ๊ฐ„๋‹จํ•œ ๊ตฌ์กฐ์˜ ๋ฌธ๋ฒ•์„ ์‚ฌ์šฉํ•˜์—ฌ ์›น์—์„œ๋„ ๋ณด๋‹ค ๋น ๋ฅด๊ฒŒ ์ปจํ…์ธ ๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ๋ณด๋‹ค ์ง๊ด€์ ์œผ๋กœ ์ธ์‹ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋งˆํฌ๋‹ค์šด์ด ์ตœ๊ทผ ๊ฐ๊ด‘๋ฐ›๊ธฐ ์‹œ์ž‘ํ•œ ์ด์œ ๋Š” ๊นƒํ—™(https://github.com) ๋•๋ถ„์ด๋‹ค. ๊นƒํ—™์˜ ์ €์žฅ์†ŒRepository์— ๊ด€ํ•œ ์ •๋ณด๋ฅผ ๊ธฐ๋กํ•˜๋Š” README.md๋Š” ๊นƒํ—™์„ ์‚ฌ์šฉํ•˜๋Š” ์‚ฌ๋žŒ์ด๋ผ๋ฉด ๋ˆ„๊ตฌ๋‚˜ ๊ฐ€์žฅ ๋จผ์ € ์ ‘ํ•˜๊ฒŒ ๋˜๋Š” ๋งˆํฌ๋‹ค์šด ๋ฌธ์„œ์˜€๋‹ค. ๋งˆํฌ๋‹ค์šด์„ ํ†ตํ•ด์„œ ์„ค์น˜๋ฐฉ๋ฒ•, ์†Œ์Šค์ฝ”๋“œ ์„ค๋ช…, ์ด์Šˆ ๋“ฑ์„ ๊ฐ„๋‹จํ•˜๊ฒŒ ๊ธฐ๋กํ•˜๊ณ  ๊ฐ€๋…์„ฑ์„ ๋†’์ผ ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฐ•์ ์ด ๋ถ€๊ฐ๋˜๋ฉด์„œ ์ ์  ์—ฌ๋Ÿฌ ๊ณณ์œผ๋กœ ํผ์ ธ๊ฐ€๊ฒŒ ๋œ๋‹ค.

1.2. ๋งˆํฌ๋‹ค์šด์˜ ์žฅ-๋‹จ์ 

1.2.1. ์žฅ์ 

@opklnm102
opklnm102 / django-test-easy-and-fast.md
Created March 3, 2017 17:58 — forked from perhapsspy/django-test-easy-and-fast.md
Django์—์„œ Test ์‰ฝ๊ณ  ๋น ๋ฅด๊ฒŒ ํ•˜๊ธฐ

Django์—์„œ Test ์‰ฝ๊ณ  ๋น ๋ฅด๊ฒŒ ํ•˜๊ธฐ

django ๊ธฐ๋ณธ ํ…Œ์ŠคํŠธ๋Š” ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ๋•์— ๋А๋ฆฌ๊ณ  ๋ฒˆ๊ฑฐ๋กญ๊ธฐ ๋•Œ๋ฌธ์— py.test์™€ model_mommy๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋น ๋ฅด๊ฒŒ ํ…Œ์ŠคํŠธ๋ฅผ ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์†Œ๊ฐœํ•จ.

ํ…Œ์ŠคํŠธ ํŒŒ์ผ ๋ ˆ์ด์•„์›ƒ

@opklnm102
opklnm102 / Java8DateTimeExamples.java
Created January 28, 2017 05:01 — forked from mscharhag/Java8DateTimeExamples.java
Examples for using the Java 8 Date and Time API (JSR 310)
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {

์ตœ๊ทผ ์ธ๊ณต์ง€๋Šฅ์„ ํ™œ์šฉํ•œ ์ฑ—๋ด‡์— ๋Œ€ํ•œ ๊ด€์‹ฌ์ด ๋†’์•„์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ฑ—๋ด‡ ์„ค๊ณ„์— ๊ด€ํ•œ ์ข‹์€ ๊ธ€์ด ์žˆ์–ด ๋ฒˆ์—ญ์„ ํ•ด๋ณด์•˜์Šต๋‹ˆ๋‹ค. ์ด ๊ธ€์€ IBM DeveloperWorks์— ๊ธฐ์žฌ๋œ Michael Yuan์˜ ๊ธ€์„ ๋ฒˆ์—ญํ•œ ๊ฒƒ์œผ๋กœ ์˜์—ญ์ด ์žˆ์Šต๋‹ˆ๋‹ค. - ๊น€์ •์ฃผ([email protected])


๋Œ€ํ™”ํ˜• ์ฑ—๋ด‡ ์„ค๊ณ„์˜ ๊ณผ์ œ

์‚ฌ์šฉ์ž๋Š” ์ฑ—๋ด‡์ด ๋งค์šฐ ๊ฐ„๋‹จํ•˜๊ณ  ์ตœ์†Œํ•œ์˜ ์š”๊ตฌ๋งŒ ํ•˜๊ธฐ์— ์ข‹์•„ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๊ฒƒ์€ ๋Œ€ํ™”์‹ ๋ฌธ์ž ๋ฉ”์‹œ์ง€์ฒ˜๋Ÿผ ๊ฐ„๋‹จํ•ด์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ, ์‚ฌ์šฉ์ž๋Š” ์ž์‹ ์ด ์„ ํ˜ธํ•˜๋Š” ๋ฉ”์‹œ์ง€ ์•ฑ์— ๊ณ„์† ๋จธ๋ฌผ๊ธฐ๋ฅผ ์„ ํ˜ธํ•ฉ๋‹ˆ๋‹ค. ์•ฑ, ์›น URL, ๋ฉ”๋‰ด, ๋ฒ„ํŠผ, ๊ด‘๊ณ , ํฌ๋กฌ ๋ฐ ๊ธฐํƒ€ ์š”์†Œ๋ฅผ ํƒ์ƒ‰ํ•˜์ง€ ์•Š๊ณ  ๋ฐ”๋กœ ๋ชฉํ‘œ๋ฅผ ๋‹ฌ์„ฑํ•˜๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์ด ๋‹จ์ˆœ์„ฑ์€ ํฐ ์„ค๊ณ„ ๊ณผ์ œ๋„ ์ œ์‹œํ•ฉ๋‹ˆ๋‹ค. ์ฑ—๋ด‡์€ ์‚ฌ์šฉ์ž์˜ ๋ง์„ ์ •ํ™•ํ•˜๊ฒŒ ์ดํ•ดํ•˜๊ณ  ์ ์ ˆํžˆ ํ–‰๋™ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์˜ค๋Š˜๋‚  ์ตœ๊ณ ์˜ ์ž์—ฐ์–ด AI (์ธ๊ณต ์ง€๋Šฅ)์—๊ฒŒ๋„ ๋งค์šฐ ์–ด๋ ค์šด ๊ณผ์ œ์ž…๋‹ˆ๋‹ค.

ํ˜„์žฌ ์ƒํƒœ์˜ AI์—์„œ๋Š”, ๋Œ€ํ™”์‹ ๋ฌธ์ž ๋ฉ”์‹œ์ง€ ๋˜๋Š” ๋Œ€ํ™”์‹(Conversational) UI, ์ฆ‰ CUI๋Š” (์•ˆํƒ€๊น๊ฒŒ๋„) ๊ฑฐ์˜ ํ•ญ์ƒ ์ž˜ ์„ค๊ณ„๋œ ๊ทธ๋ž˜ํ”ฝ UI(GUI)๋ณด๋‹ค ์—ด๋“ฑํ•ฉ๋‹ˆ๋‹ค. GUI์™€ ๋น„๊ตํ•˜์—ฌ CUI๋Š” ์ดˆ๊ธฐ ๋‹จ๊ณ„์— ์žˆ์Šต๋‹ˆ๋‹ค. ์ปค๋ฎค๋‹ˆํ‹ฐ๋กœ์„œ ์šฐ๋ฆฌ๋Š” ์—ฌ์ „ํžˆ CUI์˜ ๋””์ž์ธ ํŒจํ„ด๊ณผ ์šฐ์ˆ˜ ์‚ฌ๋ก€๋ฅผ ๋ชจ์ƒ‰ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ํŠœํ† ๋ฆฌ์–ผ์—์„œ๋Š” ์ฑ—๋ด‡์ด ์™œ ์‹คํŒจํ•˜๊ณ  ์„ฑ๊ณตํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

@opklnm102
opklnm102 / postgres-cheatsheet.md
Created November 17, 2016 14:12 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@opklnm102
opklnm102 / hanpalin
Created October 1, 2014 08:14
software global project
#include<stdio.h> //2byte์˜ ํšŒ๋ฌธ(ํ•œ๊ธ€)
#include<string.h>
int main(int argc, char *argv[])
{
char str[80],*ps,*pe;
int res;
if(argc == 2){
strcpy(str,argv[1]);
@opklnm102
opklnm102 / palin
Created October 1, 2014 08:13
software global project
#include<stdio.h> //1byte์˜ ํšŒ๋ฌธ(์˜์–ด)
#include<string.h>
int main(int argc, char *argv[])
{
char str[80],*ps,*pe;
int res;
if(argc == 2){
strcpy(str,argv[1]);
@opklnm102
opklnm102 / file_read
Created October 1, 2014 08:13
software global project
#include<stdio.h> //์‹คํ–‰ํŒŒ์ผ๊ณผ ๊ฐ™์€ ์œ„์น˜์— ์žˆ์–ด์•ผ ํŒŒ์ผ์„ ์ฐพ๋Š”๋‹ค
#include<stdlib.h>
int main(int argc, char *argv[])
{
FILE *fp1,*fp2;
char ch;
int start,end,n;
if(argc == 2)
@opklnm102
opklnm102 / file_copy
Created October 1, 2014 08:12
software global project
#include<stdio.h>
int main(int argc, char *argv[])
{
FILE *fp1,*fp2;
char ch;
fp1 = fopen("filecopy.cpp","r");
if(fp1 == NULL){
printf("Error: %s does not exist!\n","filecopy.cpp");