Skip to content

Instantly share code, notes, and snippets.

View paikwiki's full-sized avatar
🏠
Working from home

paikwiki paikwiki

🏠
Working from home
View GitHub Profile
@JamieCurnow
JamieCurnow / firestore.ts
Last active April 26, 2024 21:20
Using Firestore with Typescript
/**
* This Gist is part of a medium article - read here:
* https://jamiecurnow.medium.com/using-firestore-with-typescript-65bd2a602945
*/
// import firstore (obviously)
import { firestore } from "firebase-admin"
// Import or define your types
// import { YourType } from '~/@types'

Creational Patterns (생성 패턴)

  • Abstract Factory : 구체적인 클래스를 지정하지 않고 관련성을 갖는 객체들의 집합을 생성하거나 서로 독립적인 객체들의 집합을 생성할 수 있는 인터페이스를 제공합니다.
  • Builder : 복합 객체의 생성 과정과 표현 방법을 분리함으로써 동일한 생성 공정이 서로 다른 표현을 만들 수 있게 한다.
  • Factory Method : 객체를 생성하는 인터페이스를 정의하지만, 인스턴스를 만들 클래스의 결정은 서브클래스가 한다. Factory Method 패턴에서는 클래스의 인스턴스를 만드는 시점을 서브클래스로 미룬다.
  • Prototype : 프로토타입의 인스턴스를 이용해서 생성할 객체의 종류를 명세하고 이 프로토타입을 복사해서 새로운 객체를 생성한다.
  • Singleton : 클래스의 인스턴스는 오직 하나임을 보장하며 이 인스턴스에 접근할 수 있는 방법을 제공한다.

Structural Patterns (구조 패턴)

  • Adapter : 클래스의 인터페이스를 클라이언트가 기대하는 다른 인터페이스로 변환한다. Adapter패턴은 호환성이 없는 인터페이스 때문에 함께 사용할 수 없는 클래스를 개조하여 함께 작동하도록 해준다.
  • Bridge : 추상화와 구현을 분리하여 각각을 독립적으로 변형할 수 있게 한다.
@appkr
appkr / vim_cheatsheet.md
Last active November 6, 2018 03:50
Vim Cheatsheet

Siwtch modes

Key Description
esc normal mode
i insert mode
o insert new line
O insert preceding new line
v visual mode
V visual line
: command mode
/{keyword} search current buffer
nOR* next occurrence
NOR# prev occurrence
@muziejus
muziejus / Rakefile
Last active May 1, 2018 23:15
Jekyll Rakefile to generate tag pages without plugins for use in gh-pages sites.
# This is a ruby port of Long Qian's:
#
# https://github.com/qian256/qian256.github.io/blob/master/tag_generator.py
#
# which is a python script that accompanies this useful webpage on creating
# tags for Jekyll without plugins:
#
# http://longqian.me/2017/02/09/github-jekyll-tag/
#
# This Rakefile uses Jekyll's internals to generate the list, as opposed to
@josephg
josephg / main.c
Created August 26, 2017 08:20
kqueue network & file example
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/event.h>
#include <netdb.h>
#include <assert.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
@rizky
rizky / gui-docker.md
Last active July 26, 2020 07:18
Running Graphical applications in Docker for Mac

Setup

Docker for Mac lets you run any Linux executable in an isolated process on Mac. A graphical app is just another process, that needs access to the X11 socket of the system, or an X11 server. You can run X11 applications on a Mac using an open source project called Xquartz. The steps to expose XQuartz to a Linux process running in Docker are simple:

  1. install XQuartz from xquartz.org. Note: you need to install XQuartz version 2.7.10, version 2.7.11 does not work with Docker for Mac. Then you have 3 choices:
  2. Proxy the XQuartz socket to port 6000 or
  3. Tell Xquartz to accept network calls. This is not very secure.
  4. Tell Xquartz to accept network calls and require authentication, setup X11 security using xauth, and mount ~/.Xauthority in the container.
# lunamoth 커뮤니티 언론사 차단
127.0.0.1 ilbe.com
127.0.0.1 www.ilbe.com
127.0.0.1 m.chosun.com
127.0.0.1 news.chosun.com
127.0.0.1 chosun.com
127.0.0.1 www.chosun.com
127.0.0.1 www.donga.com
127.0.0.1 donga.com
127.0.0.1 news.donga.com
@SleepWalker
SleepWalker / swipe.js
Created September 30, 2015 04:59
A simple swipe detection on vanilla js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
@rxaviers
rxaviers / gist:7360908
Last active May 4, 2024 00:48
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@mirisuzanne
mirisuzanne / keyframes-sass-output.css
Created January 13, 2012 17:37
A Keyframes Mixin (Sass only)
@-webkit-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
100% { background-color: #ccffff; } }
@-moz-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
100% { background-color: #ccffff; } }
@-ms-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }