Skip to content

Instantly share code, notes, and snippets.

View firejune's full-sized avatar
๐Ÿ”ฅ
Working from home

Joon Kyoung firejune

๐Ÿ”ฅ
Working from home
View GitHub Profile

Creational Patterns (์ƒ์„ฑ ํŒจํ„ด)

  • Abstract Factory : ๊ตฌ์ฒด์ ์ธ ํด๋ž˜์Šค๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š๊ณ  ๊ด€๋ จ์„ฑ์„ ๊ฐ–๋Š” ๊ฐ์ฒด๋“ค์˜ ์ง‘ํ•ฉ์„ ์ƒ์„ฑํ•˜๊ฑฐ๋‚˜ ์„œ๋กœ ๋…๋ฆฝ์ ์ธ ๊ฐ์ฒด๋“ค์˜ ์ง‘ํ•ฉ์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
  • Builder : ๋ณตํ•ฉ ๊ฐ์ฒด์˜ ์ƒ์„ฑ ๊ณผ์ •๊ณผ ํ‘œํ˜„ ๋ฐฉ๋ฒ•์„ ๋ถ„๋ฆฌํ•จ์œผ๋กœ์จ ๋™์ผํ•œ ์ƒ์„ฑ ๊ณต์ •์ด ์„œ๋กœ ๋‹ค๋ฅธ ํ‘œํ˜„์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค.
  • Factory Method : ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ •์˜ํ•˜์ง€๋งŒ, ์ธ์Šคํ„ด์Šค๋ฅผ ๋งŒ๋“ค ํด๋ž˜์Šค์˜ ๊ฒฐ์ •์€ ์„œ๋ธŒํด๋ž˜์Šค๊ฐ€ ํ•œ๋‹ค. Factory Method ํŒจํ„ด์—์„œ๋Š” ํด๋ž˜์Šค์˜ ์ธ์Šคํ„ด์Šค๋ฅผ ๋งŒ๋“œ๋Š” ์‹œ์ ์„ ์„œ๋ธŒํด๋ž˜์Šค๋กœ ๋ฏธ๋ฃฌ๋‹ค.
  • Prototype : ํ”„๋กœํ† ํƒ€์ž…์˜ ์ธ์Šคํ„ด์Šค๋ฅผ ์ด์šฉํ•ด์„œ ์ƒ์„ฑํ•  ๊ฐ์ฒด์˜ ์ข…๋ฅ˜๋ฅผ ๋ช…์„ธํ•˜๊ณ  ์ด ํ”„๋กœํ† ํƒ€์ž…์„ ๋ณต์‚ฌํ•ด์„œ ์ƒˆ๋กœ์šด ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
  • Singleton : ํด๋ž˜์Šค์˜ ์ธ์Šคํ„ด์Šค๋Š” ์˜ค์ง ํ•˜๋‚˜์ž„์„ ๋ณด์žฅํ•˜๋ฉฐ ์ด ์ธ์Šคํ„ด์Šค์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์„ ์ œ๊ณตํ•œ๋‹ค.

Structural Patterns (๊ตฌ์กฐ ํŒจํ„ด)

  • Adapter : ํด๋ž˜์Šค์˜ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ๊ธฐ๋Œ€ํ•˜๋Š” ๋‹ค๋ฅธ ์ธํ„ฐํŽ˜์ด์Šค๋กœ ๋ณ€ํ™˜ํ•œ๋‹ค. AdapterํŒจํ„ด์€ ํ˜ธํ™˜์„ฑ์ด ์—†๋Š” ์ธํ„ฐํŽ˜์ด์Šค ๋•Œ๋ฌธ์— ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋Š” ํด๋ž˜์Šค๋ฅผ ๊ฐœ์กฐํ•˜์—ฌ ํ•จ๊ป˜ ์ž‘๋™ํ•˜๋„๋ก ํ•ด์ค€๋‹ค.
  • Bridge : ์ถ”์ƒํ™”์™€ ๊ตฌํ˜„์„ ๋ถ„๋ฆฌํ•˜์—ฌ ๊ฐ๊ฐ์„ ๋…๋ฆฝ์ ์œผ๋กœ ๋ณ€ํ˜•ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค.
@splacentino
splacentino / jsp.md
Last active September 15, 2024 15:11
A JSP cheat sheet

Java expression evaluated at run time.

Prototype

<%=     %>

Example

@quezo
quezo / CipherTimer.js
Created June 27, 2013 20:34
This was a small test I created to determine the fastest Cipher (an algorithm used for encryption/decryption) available in NodeJS. There was a huge variation between the best (aes-128-ofb at 305.6934) and the worst (bf-ecb at 1024.3660).
var crypto = require('crypto');
var _ = require('underscore')._;
// Returns elapsed time in milliseconds
function get_elapsed_time(startTime) {
var diff = process.hrtime(startTime);
// (seconds to milliseconds) + (nanoseconds to milliseconds)
return (diff[0] * 1000) + (diff[1] / 1000000);
}
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 20, 2025 21:14
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: