Skip to content

Instantly share code, notes, and snippets.

View soomtong's full-sized avatar
πŸ˜‡

YoungTaek soomtong

πŸ˜‡
View GitHub Profile
@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);
}
@Shiti
Shiti / lightbox.css
Last active July 26, 2018 07:05
AngularJS Lightbox directive
.modal {
width: 800px;
left: 40%;
}
.lightbox-content {
width: 100%;
}
.lightbox-image {
@plentz
plentz / nginx.conf
Last active September 29, 2026 22:19
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@jays1204
jays1204 / postbodyEnc.md
Last active September 24, 2023 04:50
Http MethodλŠ” POST, Content-Type이 application/x-www-form-urlencoded인 경우 bodyλ₯Ό encodingν•˜λŠ”κ²Œ λ§žμ„κΉŒ?

μš”μ¦˜μ˜ Request

RestFul APIλ₯Ό μ‚¬μš©ν•˜λ©° json을 많이 μ‚¬μš©ν•˜κ²Œ 됨에 따라 μš”μ¦ˆμŒμ˜ request의 Content-Type은 λŒ€λΆ€λΆ„μ΄ application/json인 것이 λ§Žλ‹€.

μ•„λ‹ˆλ©΄ 파일 첨뢀λ₯Ό μœ„ν•΄ multipart/*λ₯Ό μ‚¬μš©ν•œλ‹€. application/x-www-form-urlencodedλŠ” formμ—μ„œ default둜 μ‚¬μš©λ˜λŠ” 것 μ΄μ™Έμ—λŠ” 사싀 잘 μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” 편으둜 보인닀.

μš”μƒˆ 자주 μ‚¬μš©ν•˜μ§€ μ•Šμ§€λ§Œ, ν•˜μ§€λ§Œ μ—¬μ „νžˆ application/x-www-form-urlencodedλ₯Ό μ‚¬μš©ν•˜λŠ” κ²½μš°κ°€ μ‘΄μž¬ν•œλ‹€.

Content-Type이 닀름에 따라 뭐가 λ‹¬λΌμ§€κ² λŠλƒ ν•˜κ² μ§€λ§Œ λ‹€λ₯Έ 점이 λΆ„λͺ…νžˆ μžˆλ‹€.

@kurtsson
kurtsson / formatXML.js
Last active August 10, 2023 13:22 — forked from sente/formatXML.js
formatXML.js but without jQuery dependency
function formatXml(xml) {
var formatted = '';
var reg = /(>)(<)(\/*)/g;
xml = xml.toString().replace(reg, '$1\r\n$2$3');
var pad = 0;
var nodes = xml.split('\r\n');
for(var n in nodes) {
var node = nodes[n];
var indent = 0;
if (node.match(/.+<\/\w[^>]*>$/)) {
@lifthrasiir
lifthrasiir / crypto.md
Last active November 14, 2023 07:10
High-level understanding of cryptography

κ³ μˆ˜μ€€μ—μ„œ μ•”ν˜Έν•™ μ΄ν•΄ν•˜κΈ°

이 글은 메아리 저널에 μ“Έ λͺ©μ μœΌλ‘œ ν•œλ™μ•ˆ μž‘μ—…ν•˜λ˜ κΈ€μž…λ‹ˆλ‹€. 메아리 특유의 λ””μžμΈ(...)이 μ‹«λ‹€λ©΄ μ—¬κΈ°λ‘œ λ§ν¬ν•˜μ…”λ„ λ©λ‹ˆλ‹€. μ–΄λŠ μͺ½μ΄λ“ κ°„에 μ˜κ²¬μ€ 이 μ•„λž˜μ˜ μ½”λ©˜νŠΈ λž€ λ˜λŠ” 메아리에 κΈ°μž¬λ˜μ–΄ μžˆλŠ” 메일 μ£Όμ†Œλ₯Ό 써 μ£Όμ‹œλ©΄ κ°μ‚¬ν•˜κ² μŠ΅λ‹ˆλ‹€. --lifthrasiir

μ•”ν˜Έν•™μ„ μ‚¬μš©ν•˜λŠ” λ§Žμ€ μ‹œμŠ€ν…œμ€ μ„ΈλΆ€μ μœΌλ‘œ 무슨 μ•Œκ³ λ¦¬μ¦˜μ„ μ“°λŠ”μ§€λ³΄λ‹€λŠ” κ·Έ μ•Œκ³ λ¦¬μ¦˜λ“€μ΄ μ–΄λ–»κ²Œ μ—°κ²°λ˜μ–΄ μžˆλŠ”μ§€, 즉 ꡬ쑰가 μ‹€μ œ μ•ˆμ „μ„±μ— 더 큰 영ν–₯을 λ―ΈμΉœλ‹€. λ”°λΌμ„œ ꡬ쑰와 κ·Έ ꡬ쑰λ₯Ό μ΄λ£¨λŠ” λΉŒλ”© λΈ”λŸ­μ„ μ•„λŠ” 것이 μ€‘μš”ν•œλ°, μ—¬κΈ°μ—μ„œλŠ” μ΄λŸ¬ν•œ μ•”ν˜Έν•™μ  λΉŒλ”© λΈ”λŸ­κ³Ό ν•¨κ»˜ λΈ”λŸ­λ“€μ΄ μ–΄λ–»κ²Œ μ“°μ—¬μ„œ 더 큰 ꡬ쑰λ₯Ό λ§Œλ“œλŠ”μ§€λ₯Ό μ•Œμ•„ λ³Έλ‹€.

Key Exchange

ν‚€ κ΅ν™˜. 두 μ‚¬λžŒλ§Œμ΄ μ•Œ 수 μžˆλŠ” μƒˆλ‘œμš΄ ν‚€λ₯Ό λ§Œλ“ λ‹€. 이 과정이 λλ‚˜λ„ μƒλŒ€λ°©μ΄ λ‚΄κ°€ μ•„λŠ” μ‚¬λžŒμΈμ§„ μ•Œ 수 μ—†μ§€λ§Œ 적어도 μƒλŒ€λ°©κ³Ό λ‚΄κ°€ 같은 ν‚€λ₯Ό κ°€μ§€κ³  μžˆλ‹€λŠ” 건 ν™•μ‹ ν•  수 μžˆλ‹€.

@PurpleBooth
PurpleBooth / README-Template.md
Last active September 29, 2026 02:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jperkin
jperkin / rpio.md
Last active October 13, 2023 16:56
Raspberry Pi GPIO Comparison

Comparing node.js GPIO implementations

Here are two simple programs testing the performance of my rpio library against popular alternatives which use the /sys interface (with the number of npm stars indicated for a rough idea of popularity).

rpi-gpio (9 stars)

This test is based on an example on the rpi-gpio page.

As modules which uses /sys depend upon asynchronous behaviour they require callbacks to ensure that the next operation starts only when the previous one has completed.

@Pusnow
Pusnow / ν•œκΈ€κ³Όμœ λ‹ˆμ½”λ“œ.md
Last active July 30, 2026 17:08
ν•œκΈ€κ³Ό μœ λ‹ˆμ½”λ“œ

ν•œκΈ€κ³Ό μœ λ‹ˆμ½”λ“œ

μœ λ‹ˆμ½”λ“œμ—μ„œ ν•œκΈ€μ„ μ–΄λ–»κ²Œ λ‹€λ£¨λŠ”μ§€λ₯Ό μ •λ¦¬ν•˜μ˜€λ‹€.

μœ λ‹ˆμ½”λ“œ

  • μœ λ‹ˆμ½”λ“œ(Unicode)λŠ” μ „ μ„Έκ³„μ˜ λͺ¨λ“  문자λ₯Ό μ»΄ν“¨ν„°μ—μ„œ μΌκ΄€λ˜κ²Œ ν‘œν˜„ν•˜κ³  λ‹€λ£° 수 μžˆλ„λ‘ μ„€κ³„λœ μ‚°μ—… ν‘œμ€€ (μœ„ν‚€ λ°±κ³Ό)
  • λ‹¨μˆœνžˆ λ¬Έμžλ§ˆλ‹€ 번호λ₯Ό λΆ™μž„
  • 계속 μ—…λ°μ΄νŠΈλ˜λ©° ν˜„μž¬λŠ” Unicode Version 9.0.0 이 μ΅œμ‹ μ΄λ‹€.

UTF

  • μœ λ‹ˆμ½”λ“œλ₯Ό μ‹€μ œ 파일 등에 μ–΄λ–»κ²Œ 기둝할 것인지λ₯Ό ν‘œμ€€ν™”ν•œ 것이닀.
@kyungw00k
kyungw00k / load-script.js
Last active November 7, 2016 10:48
handle onload/onfail callback on script tag
function loadScript (src, cb) {
var userAgent = navigator.userAgent.toLowerCase()
var isIE = (userAgent.indexOf('msie') !== -1) ? parseInt(userAgent.split('msie')[1], 10) : false
var doc = document
var tag = 'script'
var el = doc.createElement(tag)
el.done = false
el.async = true
el.charset = 'utf-8'