Skip to content

Instantly share code, notes, and snippets.

View bemaru's full-sized avatar
๐Ÿข
slow and steady wins the race

Jihoon Kwak bemaru

๐Ÿข
slow and steady wins the race
View GitHub Profile
namespace Cs.Core.Core
{
using System;
using System.Collections.Generic;
using System.Linq;
// ์ฐธ๊ณ  : https://www.geeksforgeeks.org/lru-cache-implementation/
public sealed class LruCache<TKey, TElement>
{
private readonly LinkedList<(TKey Key, TElement Value)> timeline = new LinkedList<(TKey, TElement)>();
Project_name
|
|---- CMakeLists.txt
|
|---- include
| |
| |---- Project_name
| |
| |---- public_header(s).h
|
@fclairamb
fclairamb / rapidjson_gen_json.cpp
Created January 5, 2016 13:04
Write some JSON using a rapidjson library
#ifdef SHELL
g++ -Wall -Werror -g -I../../cclib/rapidjson/include $0 && ./a.out
exit 0
#endif
// Output is:
// {"project":"rapidjson","stars":11}
// {"Name":"XYZ","Rollnumer":2,"array":["hello","world"],"Marks":{"Math":"50","Science":"70","English":"50","Social Science":"70"}}
// {"FromEmail":"sender@gmail.com","FromName":"Sender's name","Subject":"My subject","Recipients":[{"Email":"recipient@gmail.com"}],"Text-part":"this is my text"}
@edsilv
edsilv / tags.sh
Last active January 18, 2018 09:29
git tags
#push tag
git push origin <tag_name>
#delete all remote tags
git tag -l | xargs -n 1 git push --delete origin
#delete all local tags
git tag | xargs git tag -d
@davidzchen
davidzchen / sample-google.c
Last active December 30, 2025 16:03
Sample C code using the Google C++ style guide
// Sample file using the Google C++ coding standard.
//
// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
//
// General rules:
// - Indents are two spaces. No tabs should be used anywhere.
// - Each line must be at most 80 characters long.
// - Comments can be // or /* but // is most commonly used.
// - File names should be lower_case.c or lower-case.c
//
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active December 18, 2025 20:10
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@makomweb
makomweb / json_with_cpp.cpp
Last active June 2, 2022 16:35
Some fun with JSON serialization/deserialization using C++ REST SDK (Codename "Casablanca").
#include <cpprest/json.h>
#include <sstream>
using namespace std;
typedef web::json::value JsonValue;
typedef web::json::value::value_type JsonValueType;
typedef std::wstring String;
typedef std::wstringstream StringStream;
String JsonValueTypeToString(const JsonValueType& type)
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@safe1981
safe1981 / Gist๋ฅผ ์ด์šฉํ•œ ์†Œ์Šค๊ด€๋ฆฌ.markdown
Last active February 23, 2019 04:55
Article:Gist์™€ Sublime์„ ์ด์šฉํ•œ Code Snippet๊ด€๋ฆฌ

#Gist๋ฅผ ์ด์šฉํ•œ ์ฝ”๋“œ์กฐ๊ฐ๊ด€๋ฆฌ ์ด๋ฒˆ ๊ธ€์—์„œ๋Š” Code Snippet์ด๋ผ ๋ถˆ๋ฆฌ๋Š” ์ฝ”๋“œ์กฐ๊ฐ์„ ํšจ๊ณผ์ ์œผ๋กœ ์–ด๋–ป๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์„๊นŒ์— ๋Œ€ํ•œ ํ•˜๋‚˜์˜ ๋ฐฉ๋ฒ•์„ ๋…ผํ•˜๊ณ ์ž ํ•œ๋‹ค. ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•˜๋‹ค๋ณด๋ฉด ๋ฌด์ˆ˜ํžˆ ๋งŽ์€ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๊ฒŒ ๋œ๋‹ค. ๋•Œ๋•Œ๋กœ ์ž‘์„ฑํ•œ ์ฝ”๋“œ ์ค‘์˜ ์ผ๋ถ€๋ฅผ ๋‚˜์ค‘์—๋„ ํ™œ์šฉํ•ด๋ณด๊ธฐ ์œ„ํ•ด ์ฝ”๋“œ๋ฅผ ๋ถ„๋ฅ˜ํ•œ๋‹ค. ๋Œ€์ฒด๋กœ ์ด๋Ÿฐ ๊ฒฝ์šฐ ์ž์‹ ๋งŒ์˜ ๋ฉ”๋ชจ์žฅ์„ ํ™œ์šฉํ•˜๊ฑฐ๋‚˜, ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ์—๋””ํ„ฐ๋ฅผ ํ™œ์šฉํ•ด์„œ ์ด๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒฝํ–ฅ์ด ์žˆ๋‹ค. ํ•˜์ง€๋งŒ ์ด๋Ÿฐ ๋ฐฉ๋ฒ•์€ ์ฝ”๋“œ๊ฐ€ ๋งŽ์•„์งˆ์ˆ˜๋ก ๊ฒ€์ƒ‰ํ•˜๊ธฐ๊ฐ€ ์‰ฝ์ง€ ์•Š๊ณ , ๊ฐœ๋ฐœ์–ธ์–ด์— ๋”ฐ๋ผ ํšจ์œจ์ ์œผ๋กœ ์ฝ”๋“œ๋ฅผ ๊ด€๋ฆฌํ•˜๊ธฐ๋„ ์–ด๋ ต๋‹ค. ๋˜ํ•œ ๊ฐœ๋ฐœํ•˜๋Š” IDEํ™˜๊ฒฝ์—์„œ๋„ ์†์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ์‚ฌ๋ฌด์‹ค/์ง‘ ๋“ฑ, ์—ฌ๋Ÿฌ ์žฅ์†Œ์—์„œ ๋™์ผํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๋„ ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค. (๋ฌผ๋ก  Dropbox)์™€ ๊ฐ™์€ ํด๋ผ์šฐ๋“œ ์„œ๋น„์Šค๋ฅผ ํ™œ์šฉํ•˜๋ฉด ์–ด๋А์ •๋„ ๋‹ค์–‘ํ•œ ํ™˜๊ฒฝ์—์„œ ํ™œ์šฉ๊ฐ€๋Šฅํ•˜์ง€๋งŒ ์ด ๋ฐฉ๋ฒ•์€ ํšŒ์‚ฌ์™€ ๊ฐ™์ด ๋ณด์•ˆ ์ƒ์˜ ์ด์œ ๋กœ ์„œ๋น„์Šค๊ฐ€ ๋ง‰ํ˜€ ์žˆ๋Š” ๊ณณ์—์„œ๋Š” ์ œ๋Œ€๋กœ ์ ์šฉ์ด ๋ถˆ๊ฐ€๋Šฅํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.

๋งŽ์€ ์›น์‚ฌ์ดํŠธ ์กฐ์‚ฌ๋ฅผ ํ†ตํ•ด ๋‹ค์–‘ํ•œ Snippet๊ด€๋ฆฌ ์„œ๋น„์Šค๋ฅผ ์ฐพ์•„๋ดค์ง€๋งŒ, ๊ทธ ์ค‘์—์„œ ๊ฐœ๋ฐœ์— ๊ฐ€์žฅ ์œ ์šฉํ•œ ๋ฐฉ์‹์€ GitHub์—์„œ ์ œ๊ณตํ•˜๋Š” Gist๋ผ๋Š” ์„œ๋น„์Šค๋ฅผ ์ด์šฉํ•˜๋Š” ๊ฒƒ์ด์—ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋ณธ ์„ธ์…˜์—์„œ๋Š” Gist๋ฅผ ์ด์šฉํ•œ Snippet๊ด€๋ฆฌ ๋ฐฉ์‹์„ ์•Œ์•„๋ณด๊ณ ์ž ํ•œ๋‹ค. ๋˜ํ•œ ์ตœ๊ทผ ๊ฐ๊ด‘๋ฐ›๊ณ  ์žˆ๋Š” Sublime Text์—์„œ Gistํ”Œ๋Ÿฌ๊ทธ์ธ์„ ํ™œ์šฉํ•˜์—ฌ ์–ด๋–ป๊ฒŒ ํšจ์œจ์ ์œผ๋กœ ๊ฐœ๋ฐœEditor์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š”์ง€๋„ ์•Œ์•„๋ณด๊ณ ์ž ํ•œ๋‹ค.

#Gistํ™˜๊ฒฝ ์…‹ํŒ…

Github ํšŒ์›๊ฐ€์ž…

Gist ์‚ฌ์šฉ์„ ์œ„ํ•ด์„œ๋Š” GitHub ํšŒ์›๊ฐ€์ž…์„ ํ•œ๋‹ค. Github๋Š” ๋งค์šฐ ์œ ๋ช…ํ•˜๊ณ  ๋„๋ฆฌ ํผ์ ธ์žˆ๋Š” ์„œ๋น„์Šค์ด๋ฏ€๋กœ ์„œ๋น„์Šค๊ฐ€ ์ค‘๋‹จ๋  ๊ฑฑ์ •์„ ํ•˜์ง€ ์•Š๊ณ  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ์™ธ๊ตญ์‚ฌ์ดํŠธ์ด๋‹ˆ๋งŒํผ ํšŒ์›์ •๋ณด๋„ ๊ณผ๋„ํ•˜๊ฒŒ ์š”๊ตฌํ•˜์ง€ ์•Š๋Š”๋‹ค.

Sublime์— Gist ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค์น˜