Skip to content

Instantly share code, notes, and snippets.

View Dev-HyunSang's full-sized avatar
๐Ÿ‘‹
Hey, It's me!

HyunSang Park Dev-HyunSang

๐Ÿ‘‹
Hey, It's me!
View GitHub Profile

pprof ์‚ฌ์šฉ๋ฒ•

1. pprof์˜ ๊ตฌ๋ถ„

  1. go tool pprof ํ”„๋กœ๊ทธ๋žจ:
    • pprof ๋ฐ์ดํ„ฐ๋ฅผ ๋ถ„์„ํ•˜์—ฌ ๋ณด์—ฌ ์ฃผ๋Š” pprof ๋ฐ”์ด๋„ˆ๋ฆฌ๋‹ค.
  2. runtime/pprof ํŒจํ‚ค์ง€:
    • Go ํ”„๋กœ๊ทธ๋žจ์œผ๋กœ๋ถ€ํ„ฐ pprof ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ๋‚ด๋ณด๋‚ด๋Š” ์ผ์„ ํ•˜๋Š” ํŒจํ‚ค์ง€๋‹ค.
  3. net/http/pprof ํŒจํ‚ค์ง€:
    • runtime/pprof ํŒจํ‚ค์ง€๊ฐ€ ํ•˜๊ณ  ์žˆ๋Š” ๊ฒƒ์„ (ServeHTTP๋กœ) ์›น์œผ๋กœ ๋‚ด๋ณด๋‚ด๊ฑฐ๋‚˜ ํ”„๋กœ๊ทธ๋žจ์˜ pprof ๋ฐ์ดํ„ฐ๋ฅผ ๋ถ„์„ํ•˜์—ฌ ์›น ์ธํ„ฐํŽ˜์ด์Šค๋กœ ๋ณด์—ฌ ์ฃผ๋Š” ์ผ์„ ํ•˜๋Š” ํŒจํ‚ค์ง€๋‹ค.
@MarioCarrion
MarioCarrion / init.vim
Last active July 16, 2023 14:30
Basic nvim configuration
let mapleader = ","
filetype on
filetype indent on
filetype plugin on
set encoding=UTF-8
syntax on
set nocompatible
@heolin
heolin / axiosExample
Created November 25, 2019 15:48
Simple axios example generating html table
<html>
<head>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<table class="table">
<thead>
<th>id</th>
<th>email</th>
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active November 22, 2025 09:07
Conventional Commits Cheatsheet
@egoing
egoing / The OAuth 2.0 Authorization Framework: Bearer Token Usage.md
Last active October 11, 2023 03:57
Bearer Authentication ์— ๋Œ€ํ•ด์„œ ์‚ดํŽด๋ด…๋‹ˆ๋‹ค.

์†Œ๊ฐœ

์ด ๊ธ€์€ Oauth๋ฅผ ์ด์šฉํ•ด์„œ access token์„ ํš๋“ํ•œ ํ›„์— api์— ์ ‘์†ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์„ค๋ช…ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์šฐ์„  ๊ณต๋ถ€ํ•ด์•ผ ํ•  ๊ฒƒ๋“ค

์ด ๊ธ€์€ WEB2 OAuth2 ์ˆ˜์—…๊ณผ WEB2 HTTP ์ˆ˜์—…์— ์˜์กดํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. OAuth์™€ HTTP๋ฅผ ์ž˜ ๋ชจ๋ฅด์‹ ๋‹ค๋ฉด ์ด ์ˆ˜์—…๋“ค์„ ๋จผ์ € ๋ณด์‹œ๊ณ  ์ด ๊ธ€์„ ๋ณผ ๊ฒƒ์„ ๊ถŒํ•ด๋“œ๋ฆฝ๋‹ˆ๋‹ค.

Bearer Authentication๋ž€?

API์— ์ ‘์†ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” access token์„ API ์„œ๋ฒ„์— ์ œ์ถœํ•ด์„œ ์ธ์ฆ์„ ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ์ธ์ฆ ๋ฐฉ๋ฒ•์ด Bearer Authentication ์ž…๋‹ˆ๋‹ค. ์ด ๋ฐฉ๋ฒ•์€ OAuth๋ฅผ ์œ„ํ•ด์„œ ๊ณ ์•ˆ๋œ ๋ฐฉ๋ฒ•์ด๊ณ , RFC 6750์— ํ‘œ์ค€๋ช…์„ธ์„œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

@babldev
babldev / decode_flask_cookie.py
Last active December 15, 2023 12:02
Decode a Flask Session cookie, given the cookie and secret key
@ihoneymon
ihoneymon / how-to-write-by-markdown.md
Last active November 15, 2025 03:29
๋งˆํฌ๋‹ค์šด(Markdown) ์‚ฌ์šฉ๋ฒ•

[๊ณตํ†ต] ๋งˆํฌ๋‹ค์šด markdown ์ž‘์„ฑ๋ฒ•

์˜์–ด์ง€๋งŒ, ์กฐ๊ธˆ ๋” ์ƒ์„ธํ•˜๊ฒŒ ๋งˆํฌ๋‹ค์šด ์‚ฌ์šฉ๋ฒ•์„ ์•ˆ๋‚ดํ•˜๊ณ  ์žˆ๋Š”
"Markdown Guide (https://www.markdownguide.org/)" ๋ฅผ ๋ณด์‹œ๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค. ^^

์•„, ๊ทธ๋ฆฌ๊ณ  ๋งˆํฌ๋‹ค์šด๋งŒ์œผ๋กœ ํ‘œํ˜„์ด ๋ถ€์กฑํ•˜๋‹ค๊ณ  ๋А๋ผ์‹ ๋‹ค๋ฉด, HTML ํƒœ๊ทธ๋ฅผ ํ™œ์šฉํ•˜์‹œ๋Š” ๊ฒƒ๋„ ์ข‹์Šต๋‹ˆ๋‹ค.

1. ๋งˆํฌ๋‹ค์šด์— ๊ด€ํ•˜์—ฌ

@adamveld12
adamveld12 / comments.md
Last active May 25, 2025 15:16
Go Code Review Comments

Go Code Review Comments

This page collects common comments made during reviews of Go code, so that a single detailed explanation can be referred to by shorthands. This is a laundry list of common mistakes, not a style guide.

You can view this as a supplement to http://golang.org/doc/effective_go.html.

Please discuss changes before editing this page, even minor ones. Many people have opinions and this is not the place for edit wars.

@mattes
mattes / check.go
Last active October 13, 2025 14:50
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}