Skip to content

Instantly share code, notes, and snippets.

View SeonghuiChoe's full-sized avatar

SeonghuiChoe(web) SeonghuiChoe

View GitHub Profile
[user]
name = SeonghuiChoe
email = shchoe@pyundoori.com
[color]
ui = auto
[core]
excludesfile = /Users/choeseonghui/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
@SeonghuiChoe
SeonghuiChoe / webpack.config.3.js
Last active February 12, 2018 06:56
webpack.config.js version1
const webpack = require('webpack');
module.exports = {
entry: './webpack.js',
output: {
path: __dirname + '/dist/',
filename: 'bundle.js',
},
module: {
rules: [{
@SeonghuiChoe
SeonghuiChoe / Javascript-quiz3.js
Last active June 20, 2017 05:51
javascript 문제 세번째
/*
* 문자열에서 최소값과 최대값 출력
* ex) "1 2 3 4" => "1 4"
*/
var input = '1 2 33 4';
var arr = input.match(/\d+/g).map(n => parseInt(n));
var arrMinMax = arr.reduce((pre, curr) => {
var min = curr < pre[0] ? curr : pre[0];
@SeonghuiChoe
SeonghuiChoe / pad-trainer.md
Last active October 31, 2017 01:44
pad-trainer

ionic serve

ionic run android —device

  1. 빈 node_modules이 있을 경우
Uh oh! Looks like you're missing a module in your gulpfile:
Cannot find module 'gulp'
Do you need to run `npm install`?
rm -rf node_modules/
@SeonghuiChoe
SeonghuiChoe / Javascript-quiz2-1.js
Last active May 29, 2017 04:14
javascript 문제 두번째
var privacy = {
secret: "I did not study last night.",
getSecret: function () {
return this.secret;
}
};
var what = privacy.getSecret;
console.log(what());
@SeonghuiChoe
SeonghuiChoe / git-merge.md
Last active May 17, 2017 12:41
git and github

merge

다른 사람의 업데이트 이력을 내 저장소에도 갱신

file pull and merge origin/master 다른파일 같은파일
file만 수정 pull and merge 문제없이 pull Please commit your changes or stash them
before you can merge. Aborting
file을 수정하고
commit
pull and merge 바로 commit editor실행되며
merge기본 형식의 message가 미리 적힌 상태 
CONFLICT (content): Merge conflictm
different commits each.
both modified:   README.md

both modified

@SeonghuiChoe
SeonghuiChoe / javascript-quiz.js
Last active April 23, 2017 07:33
Javascript 문제
var yangpa5 = "Marry me";
function print_value() {
console.log(yangpa5);
var yangpa5 = "나 때문에";
console.log(yangpa5);
function nested() {
console.log(yangpa5);
@SeonghuiChoe
SeonghuiChoe / linux-language-ko.md
Last active April 21, 2017 06:17
linux에서 한글 설정하기

linux에서 한글 설정하기

$ sudo apt-get install language-pack-ko

API RULES

API parameter

사용하는 API에 비슷한 로직이 생기면서 중복을 없애기 위해 특정한 parameter를 넘겨주면서 같은 API가 다른 동작을 하도록 로직을 만든다.
예를들어 어떤 함수가 있는데 parameter를 이용해 게시글을 등록하거나 수정하는 일들을 구분해서 실행한다.
작업하던 코드에서 enum과 같이 숫자를 넘겨주던가 'Y', 'N'와 같은 문자를 넘겨주는 부분을 많이 봤는데, 이 방식이 옳은것인지 대해 고민을 하게 되었다.

GitHub API 방식

  • Edit an issue 부분에 'state'라는 parameter가 있는데, description에 State of the issue. Either open or closed.라고 적혀있다.