Skip to content

Instantly share code, notes, and snippets.

View appkr's full-sized avatar
๐ŸŽฏ
Focusing

appkr appkr

๐ŸŽฏ
Focusing
View GitHub Profile
@appkr
appkr / Charicteristic of Java reference type.md
Last active April 28, 2021 01:05
Charicteristic of Java reference type

String type example

  • ์ฐธ์กฐ ํƒ€์ž…์—์„œ ==, != ์—ฐ์‚ฐ์€ ๊ฐ™์€ ๊ฐ์ฒด์ธ์ง€๋ฅผ ๋น„๊ตํ•œ๋‹ค. ์ฆ‰ ๋ฉ”๋ชจ๋ฆฌ ๋ฒˆ์ง€๊ฐ€ ๊ฐ™์€์ง€๋ฅผ ๋น„๊ตํ•œ๋‹ค.
  • ๊ฐ’์„ ๋น„๊ตํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” Object.equals API๋ฅผ ์ด์šฉํ•œ๋‹ค
jshell> String var1 = "appkr";
strVar1 ==> "appkr"

jshell> String var2 = "appkr";
strVar2 ==> "appkr"
@appkr
appkr / howto_install_old_version_of_php.md
Last active September 25, 2021 06:50
How to intall [email protected] with homebrew in MacOS

Workaround

Register the custom repostory as homebrew tap

~ $ TAP=appkr/homebrew-repo
~ $ brew tap $TAP

Install the binary from the custom repository AS USUAL

@appkr
appkr / the_5things_we_cannot_change.md
Created September 12, 2019 04:37
์ ˆ๋Œ€๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์—†๋Š” ๋‹ค์„ฏ ๊ฐ€์ง€

๊ณ„ํš์„ ์„ธ์šฐ๋Š” ๊ฒƒ์€ ์„ฑ์ˆ™ํ•œ ํ™œ๋™์ด๊ณ , ๊ฑด๊ฐ•ํ•œ ์ž์˜์˜ ํŠน์ง•์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์™„๋ฒฝํ•˜๊ฒŒ ํ†ต์ œํ•˜๊ณ  ์ง€๋ฐฐํ•˜๊ณ  ์‹ถ์–ดํ•˜๋Š” ์š•๊ตฌ๋Š” ์˜คํžˆ๋ ค ์ธ์ƒ์˜ ๊ธฐ์จ์„ ๋†“์น˜๋Š” ์ฒฉ๊ฒฝ์ด ๋ฉ๋‹ˆ๋‹ค. ์ธ์ƒ์€ ๋Š˜ ๊ณ„ํš๋Œ€๋กœ ๋˜์ง€๋Š” ์•Š์Šต๋‹ˆ๋‹ค.

๋ถˆํ™ฉ์‹ค์„ฑ์€ ์‚ถ์˜ ๋ณธ์งˆ์ž…๋‹ˆ๋‹ค.


๊ณ„ํš๋Œ€๋กœ ๋˜๊ธฐ๋ฅผ ๋ฐ”๋ผ๋Š” ์š•๊ตฌ๋งŒ ๊ฐ–๊ณ  ์žˆ๊ณ , ๊ณ„ํš๊ณผ๋Š” ๋‹ค๋ฅด๊ฒŒ ์ผ์–ด๋‚˜๋Š” ์ผ๋“ค์„ ์ธ์ •ํ•˜๊ณ  ์ ์‘ํ•˜๋Š” ๋Šฅ๋ ฅ์ด ๋ถ€์กฑํ•˜๋‹ค๋ฉด ์šฐ๋ฆฌ๋Š” <์ธ์ƒ ์กฐ๊ฑด>์— ์–ธ์ œ๋‚˜ ๋‚œํƒ€๋‹นํ•˜๊ธฐ๋งŒ ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

  • ์ ˆ๋Œ€๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์—†๋Š” ๋‹ค์„ฏ ๊ฐ€์ง€
@appkr
appkr / ImmutabilityTest.java
Last active September 14, 2020 06:05
Is Java HashMap and ArrayList immutable? NOPE. The same is true for other languages.
package kata;
import org.junit.Test;
import java.util.*;
import static org.junit.Assert.*;
public class MutabilityTest {
@Test
public void isJavaMapImmutable() {
@appkr
appkr / php_cpu.md
Last active July 24, 2019 12:33
PHP์˜ CPU ์‚ฌ์šฉ์— ๊ด€ํ•œ ์‹คํ—˜

ํŽ˜์ด์Šค๋ถ์˜ ํ† ๋ก  ์“ฐ๋ ˆ๋“œ : https://www.facebook.com/groups/655071604594451/permalink/1906495189452080/

์‹คํ—˜ ๋ฐฐ๊ฒฝ

  • PHP ๋Ÿฐํƒ€์ž„๊ณผ PHP ์–ธ์–ด๋Š” ์‹ฑ๊ธ€ ์“ฐ๋ ˆ๋“œ ๋ชจ๋ธ๋กœ ๊ตฌํ˜„๋˜์—ˆ๋‹ค
  • ๋ฉ€ํ‹ฐ CPU ์ฝ”์–ด ํ™˜๊ฒฝ์—์„œ, PHP ๋Ÿฐํƒ€์ž„์ด ๋‹จ์ผ PHP ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•  ๋•Œ, CPU๋ฅผ ์–ด๋–ป๊ฒŒ ์‚ฌ์šฉํ• ๊นŒ?

์ž ์ • ๊ฒฐ๋ก 

  • CPU bound ์ž‘์—…๊ณผ IO bound ์ž‘์—…์˜ CPU ์‚ฌ์šฉ ์–‘์ƒ์€ ์„œ๋กœ ๋‹ค๋ฅด๋‹ค
  • ์‹คํ—˜ ์˜์ƒ: https://youtu.be/jhURfE6yHBQ
@appkr
appkr / postgis.md
Last active November 5, 2020 03:30
PostGIS, Postgre

101

Create table

CREATE DATABASE db_name ENCODING=utf8 lc_collate="C" template=template0;

-- Reconnect to `db_name` database
-- @see https://stackoverflow.com/questions/3949876/how-to-switch-databases-in-psql
CREATE EXTENSION postgis;
@appkr
appkr / kotlin.md
Created July 21, 2019 13:53
Kotlin