Skip to content

Instantly share code, notes, and snippets.

View dongjinahn's full-sized avatar
๐Ÿ’ญ
โ›„๏ธ

Dong-jin Ahn dongjinahn

๐Ÿ’ญ
โ›„๏ธ
View GitHub Profile
@rollin96
rollin96 / jupyter_matplotlib_korean_font
Created May 8, 2018 07:58
jupyter์—์„œ matplotlib๋ฅผ ์œ„ํ•ด ํ•œ๊ธ€ํฐํŠธ๋ฅผ ๊ฐ€์ ธ๋‹ค ์“ฐ๋Š” ๋ฐฉ๋ฒ•.
# 1: ํ•œ๊ธ€์„ ๊ทธ๋ƒฅ ์จ๋ณด๋ฉด ๋ฐ•์Šค๋งŒ ๊ทธ๋ ค์ง.
import matplotlib.pyplot as plt
plt.text(0.5, 0.5, ['ํ•œ๊ธ€', 'test'])
plt.show()
# 2: ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•ด์ฃผ๋ฉด ํ•œ๊ธ€์ด ์ž˜ ๋™์ž‘ํ•จ.
# ใ„ด ์‹œ์Šคํ…œ์— install์ด ์ž˜ ๋˜์–ด ์žˆ๋‹ค๋ฉด mpl.rcParams[] ์„ค์ •๋งŒ ํ•˜๋ฉด ๋˜๋Š”๋ฐ, docker์— ๋„์šด jupyter์—์„œ๋Š” ์™ ์ง€ apt-get์œผ๋กœ ์„ค์น˜ํ•œ font๋ฅผ ์ธ์‹ํ•˜์ง€ ๋ชปํ•œ๋‹ค.
import matplotlib as mpl
import matplotlib.font_manager as fm
@rawrmaan
rawrmaan / killglobals.sh
Created April 19, 2017 21:19
Kill React Native typings globals so we can use node globals too
#!/usr/bin/env bash
ed -s ./node_modules/@types/react-native/index.d.ts <<< $',s/declare global/declare namespace FuckGlobals/g\nw'
@jooyunghan
jooyunghan / monad-in-java.md
Last active November 17, 2023 04:54
ํ•œ๊ธ€๋ฒˆ์—ญ - Functor and monad examples in plain Java

Functor and monad examples in plain Java

์ด ๊ธ€์€ ์šฐ๋ฆฌ๊ฐ€ ์“ด ์ฑ…, 'Reactive Programming with RxJava' ์˜ ๋ถ€๋ก์ด์—ˆ๋‹ค. Reactive programming๊ณผ ๊ด€๋ จ์ด ๊นŠ์€ ์ฃผ์ œ๊ธด ํ•˜์ง€๋งŒ ๋ชจ๋‚˜๋“œ๋ฅผ ์†Œ๊ฐœํ•œ๋‹ค๋Š” ๊ฒŒ ์ฑ…๊ณผ ์ฉ ์–ด์šธ๋ฆฌ์ง€๋Š” ์•Š์•˜๋‹ค. ๊ทธ๋ž˜์„œ ๋‚˜๋Š” ๋”ฐ๋กœ ๋ธ”๋กœ๊ทธ์— ์˜ฌ๋ฆฌ๊ธฐ๋กœ ํ–ˆ๋‹ค. ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ๋‹ค๋ฃจ๋Š” ๋ธ”๋กœ๊ทธ์—์„œ *"๋ฐ˜์€ ๋งž๊ณ  ๋ฐ˜์€ ํ‹€๋ฆด ์ง€ ๋ชจ๋ฅด๋Š” ๋‚˜๋งŒ์˜ ๋ชจ๋‚˜๋“œ ์„ค๋ช…"*์ด๋ž€ ๊ฒƒ์ด ์ƒˆ๋กœ์šด *"Hello World"*๋ผ๋Š” ์ ์„ ๋‚˜๋„ ์ž˜ ์•ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ด ๊ธ€์€ ํŽ‘ํ„ฐ(functor)์™€ ๋ชจ๋‚˜๋“œ(monad)๋ฅผ ์ž๋ฐ” ์ž๋ฃŒ ๊ตฌ์กฐ์™€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ผ๋Š” ๊ฐ๋„์—์„œ ๋ฐ”๋ผ๋ณด๊ณ  ์žˆ์œผ๋ฉฐ, ์ด๋Š” ๊ณต์œ ํ•  ์ •๋„์˜ ๊ฐ€์น˜๋Š” ์žˆ์„๊ฑฐ๋ผ ์ƒ๊ฐํ–ˆ๋‹ค.

@squarism
squarism / iterm2.md
Last active September 29, 2025 18:50
An iTerm2 Cheatsheet

In the below keyboard shortcuts, I use the capital letters for reading clarity but this does not imply shift, if shift is needed, I will say shift. So โŒ˜ + D does not mean hold shift. โŒ˜ + Shift + D does of course.

Tabs and Windows

Function Shortcut
New Tab โŒ˜ + T
Close Tab or Window โŒ˜ + W (same as many mac apps)
Go to Tab โŒ˜ + Number Key (ie: โŒ˜2 is 2nd tab)
Go to Split Pane by Direction โŒ˜ + Option + Arrow Key
@matthewmueller
matthewmueller / escape-json.js
Created August 25, 2012 02:50
Escape JSON strings before trying to run JSON.parse
/*
Escape JSON
*/
var escapeJSON = exports.escapeJSON = function(json) {
var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
var meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',