Skip to content

Instantly share code, notes, and snippets.

View kciter's full-sized avatar
๐Ÿ‘€
Focusing

Sunhyoup Lee kciter

๐Ÿ‘€
Focusing
View GitHub Profile

Flask + Nginx ์„ค์น˜ ๋ฐฉ๋ฒ•

ํ™˜๊ฒฝ

๋ฐ๋น„์•ˆ ๊ณ„์—ด ์ค‘ ์šฐ๋ถ„ํˆฌ ์„œ๋ฒ„
์—ฌ๊ธฐ์„œ ์ ‘๊ทผํ•˜๋Š” ๋ชจ๋“  ๋””๋ ‰ํ† ๋ฆฌ๋Š” ๊ถŒํ•œ์ด ์žˆ์–ด์•ผํ•จ.

์„ค์น˜

@kciter
kciter / ์‹ฑ๊ธ€ํ†ค ํŒจํ„ด.md
Last active August 29, 2015 13:57
์‹ฑ๊ธ€ํ†ค ํŒจํ„ด (Singleton Pattern)

์‹ฑ๊ธ€ํ†ค ํŒจํ„ด์ด๋ž€ ๋‹จ ํ•˜๋‚˜์˜ ๊ฐ์ฒด๋กœ ์กด์žฌํ•ด์•ผํ•˜๋Š” ๊ฐ์ฒด๋ฅผ ๊ตฌํ˜„ํ•ด์•ผ ํ•  ๋•Œ ๋งŽ์ด ์‚ฌ์šฉ๋œ๋‹ค.
์ฃผ๋กœ ๊ฐ์ฒด์˜ ๋ถ€์ ์ ˆํ•œ ์˜์กด๊ด€๊ณ„๋ฅผ ์ง€์šฐ๊ธฐ ์œ„ํ•ด ๋งŽ์ด ์‚ฌ์šฉ๋˜์ง€๋งŒ ๊ฐ์ฒด์ง€ํ–ฅ ๊ฐœ๋…์„ ์ž˜ ๋ชจ๋ฅด๊ณ  ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ ์˜คํžˆ๋ ค ๋” ์•ˆ์ข‹์€ ์ฝ”๋“œ๊ฐ€ ๋  ๊ฐ€๋Šฅ์„ฑ์ด ๋†’๋‹ค.

์†Œ์Šค๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. (C++๋กœ ์ž‘์„ฑ๋จ)

#include <stdio.h>

class MyClass
{
public:
@kciter
kciter / ๋Œ•๊ธ€๋ง ํฌ์ธํ„ฐ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•.md
Created March 6, 2014 11:45
๋Œ•๊ธ€๋ง ํฌ์ธํ„ฐ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

๋Œ•๊ธ€๋ง ํฌ์ธํ„ฐ๋ž€ ์ด๋ฏธ ํ•ด์ œ๋œ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๊ฐ€๋ฆฌํ‚ค๊ณ  ์žˆ๋Š” ํฌ์ธํ„ฐ๋ฅผ ๋œปํ•œ๋‹ค.

#include <stdio.h>
int main() {
    int *p = (int*)malloc(sizeof(int));
    free(p); // p๋Š” ๋Œ•๊ธ€๋ง ํฌ์ธํ„ฐ
    p = 1; // ์ด๋ฏธ ํ•ด์ œํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒ
}
@kciter
kciter / solution.cpp
Last active August 29, 2015 13:59
๋งค์ผ์ฝ”๋”ฉ 4์›” 16์ผ ๋ฌธ์ œ: http://oj.leetcode.com/problems/linked-list-cycle/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
#include <map>
@kciter
kciter / gulpfile.js
Created July 29, 2016 05:22
gulp ์„ค์ •
'use strict';
var gulp = require('gulp'),
gutil = require('gulp-util'),
rename = require('gulp-rename'),
glob = require('glob'),
sass = require('gulp-sass'),
cleanCSS = require('gulp-clean-css'),
babelify = require('babelify'),
browserify = require('browserify'),
@kciter
kciter / RxAlamofire+ObjectMapper.swift
Created August 11, 2016 02:52
RxAlamofire+ObjectMapper
import UIKit
import RxSwift
import RxAlamofire
import ObjectMapper
class Post: Mappable {
var id: Int = 0
var title: String = ""
required init?(_ map: Map) {
@kciter
kciter / disable_friendlyTap.md
Created September 21, 2016 12:25
KCFloatingActionButton friendlyTap ํ•ด์ œ ๋ฐฉ๋ฒ•

UIWindow ๊ธฐ๋ฐ˜์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ

KCFABManager.defaultInstance().getButton().friendlyTap = false

UIViewController ๊ธฐ๋ฐ˜์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ

let fab = KCFloatingActionButton()
fab.friendlyTap = false
import gulp from 'gulp';
import sass from 'gulp-sass';
import autoprefixer from 'gulp-autoprefixer';
import sourcemaps from 'gulp-sourcemaps';
import uglify from 'gulp-uglify';
import rename from 'gulp-rename';
import cleanCSS from 'gulp-clean-css';
import browserify from 'browserify';
import babelify from 'babelify';
import source from 'vinyl-source-stream';
@kciter
kciter / FRONTEND.md
Last active September 3, 2019 08:39

ํ”„๋ก ํŠธ์—”๋“œ ํŒ

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)