Skip to content

Instantly share code, notes, and snippets.

View peterkimzz's full-sized avatar

Peter Donghyun Kim peterkimzz

View GitHub Profile
@peterkimzz
peterkimzz / cookie.ts
Last active June 28, 2020 16:05
[Express.js] Cookie
@peterkimzz
peterkimzz / cloudSettings
Last active July 3, 2020 01:20
VSCode Settings Sync
{"lastUpload":"2020-07-03T01:20:53.138Z","extensionVersion":"v3.4.3"}
@peterkimzz
peterkimzz / ngram.sql
Last active April 25, 2019 05:34
mysql ngram indexing
ALTER TABLE TABLE_NAME ADD FULLTEXT INDEX ngram_index_name(COLUMN_NAME) WITH PARSER ngram;
e.g.
ALTER TABLE users ADD FULLTEXT INDEX ngram_users_name(name) WITH PARSER ngram;
SELECT u.*
FROM users u
WHERE MATCH(u.name) AGAINST("peter" IN BOOLEAN MODE)
@peterkimzz
peterkimzz / nginx
Created April 25, 2019 04:47
nginx https, proxy
server {
listen 80;
client_max_body_size 20M;
if ($http_x_forwarded_proto = 'http'){
return 301 https://$host$request_uri;
}
server_name *.amazonaws.com;
@peterkimzz
peterkimzz / cors.middleware.js
Created April 25, 2019 01:17
nodejs cors 설정
const cors = (req, res, next) => {
// 와일드카드 (*)가 안먹혀서 일일이 배열안에 적어주면 됨
const allowedOrigins = [
'http://localhost:3000',
'http://localhost:3001',
'http://localhost:3002',
'http://localhost:3003',
'https://test.domain.com',
'https://domain.com',
@peterkimzz
peterkimzz / cookie.js
Last active April 25, 2019 01:14
도메인 공유 쿠키
@peterkimzz
peterkimzz / tel.js
Created April 25, 2019 01:11
한국 안심번호 서비스 api
const CustomError = require('@errors')
const axios = require('axios')
const md5 = require('md5')
const qs = require('qs')
const urlencode = require('urlencode')
const addOne = (options = {}) => {
if (process.env.NODE_ENV !== 'production')
return {
data: { VirtualNumber: '0508-0000-0000w' }
@peterkimzz
peterkimzz / CameraController.cs
Last active April 15, 2019 08:38
카메라 이동 및 줌 인 아웃
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraController : MonoBehaviour
{
[SerializeField]
public Transform target;
[SerializeField]
@peterkimzz
peterkimzz / ObjectMove.cs
Last active April 15, 2019 14:55
캐릭터 땅 클릭으로 이동하기
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
// 이동속도
[SerializeField]
private float moveSpeed;
private bool isMoving = false;
// 브라우저 뒤로가기 눌렀을 때 발생하는 이벤트
addEventListeners() {
window.onpopstate = () => {
this.isLoungeVisible = false
window.scrollTo(0, this.scrollY)
}
},
fetchLounges() {
const options = {
method: 'get',