Skip to content

Instantly share code, notes, and snippets.

View qkreltms's full-sized avatar
💖
Happy coding

JungHoonPark qkreltms

💖
Happy coding
View GitHub Profile
@qkreltms
qkreltms / gist:28e500baf7a0cbd81e8ea5ccca6e8cbc
Last active March 22, 2019 12:49 — forked from paulallies/gist:0052fab554b14bbfa3ef
깃허브에서 node_modules 제거하는 방법.
# .gitignore file에 node_modules 추가
git rm -r --cached node_modules
git commit -m 'Remove and ignore directory node_modules'
git push origin master
@qkreltms
qkreltms / README.md
Last active January 21, 2019 04:41
Postman form-data로 object보내기

밑의 json을 postman으로 서버에 보내고 싶은데 고민끝에 찾은 방법을 소개합니다.

raw, json { "loc": { "coordinates": [126.934216, 37.529047] }, }

postman form-data object with array

@qkreltms
qkreltms / README.md
Last active March 22, 2019 12:55
Currying and ES6 Arrow Functions
@qkreltms
qkreltms / ob.js
Created December 28, 2018 11:17
javascript object가 초기화 되었는지 확인하는 방법
if (obj) {
//값이 있을 경우
}
//응용
arr = [1, 2, 3]
arr.length ? return (obj.map((number) => <h1>{number}</h1>)) : return (<h1>값이 없음!</h1>)
@qkreltms
qkreltms / methodVSfunction.js
Created December 21, 2018 11:43
javascript: method vs function
//method는 오브젝트 안에서 f:function() {} 이런식으로 되어있는 것을 말하고, this가 메소드가 속해있는 객체를 가리킨다.
//function은 function f() {} 이런식으로 되어있는 것을말하고 this가 window를 가리킨다.
var a = {
methods: {
methodOfObject: function() {
console.log("callit!")
functionBelongsToWindow()
function functionBelongsToWindow() {
console.log("in functionBelongsToWindow()"+this) // window를 가리키는 this
@qkreltms
qkreltms / README.md
Last active February 5, 2019 10:48
Arrow function 정리

ES6: Arrow function

목차

  1. 쓰는 방법
  2. 쓰는 이유
  3. Arrow function을 사용하지 않는다면…?
  4. Arrow function과 Closure의 연관관계

1) 쓰는 방법

@qkreltms
qkreltms / Simple_Generate_Thumbnail_Example.js
Last active January 22, 2019 17:36
Generate Thumbnail Example
/*1. install GraphicsMagick on Your PC (I installed it on C:)
/*2. install gm pakcage npm i --save gm
/*3. install request npm i --save request
/*4. test this code
/*
/*
*/
const fs = require('fs'),
gm = require('gm').subClass({
imageMagick: true
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const crypto = require('crypto');
const mongoose = require('mongoose');
const multer = require('multer');
const GridFsStorage = require('multer-gridfs-storage');
const Grid = require('gridfs-stream');
const app = express();
@qkreltms
qkreltms / index.js
Last active September 12, 2023 02:42
Simple SheetJS Example with VueJS
/*
Let't start
1. Create a vue project with vue-cli
2. npm i xlsx
3. copy below code & paste to App.vue
4. npm run dev
Here are links that I referenced to make this code.
SheetJS: https://github.com/SheetJS/js-xlsx
Drop & Drag: https://codepen.io/Event_Horizon/pen/WodMjp
@qkreltms
qkreltms / simple_geojson_example.js
Last active September 4, 2018 07:44
simple_geojson_example
/*
This one is for post request
{
"name": "test",
"rank": "red belt",
"available": true,
"loc" : {"type": "Point", "coordinates": [-80, 27]}
}
This one is for get request
http://localhost:3030/ninjas?lng=-80&lat=20