Skip to content

Instantly share code, notes, and snippets.

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

appkr appkr

๐ŸŽฏ
Focusing
View GitHub Profile
@appkr
appkr / favorite
Last active October 21, 2018 13:10
PHP Streams from the book "Modern PHP" by Josh Lockhart
- https://github.com/codeguy/modern-php/tree/master/05-good-practices/streams
- http://php.net/manual/en/book.stream.php
- http://php.net/manual/en/wrappers.php.php
@appkr
appkr / homebrew_cask.md
Created October 21, 2018 13:07
Homebrew Cask Cheatsheet
@appkr
appkr / serialize_unserize_sleep.md
Created October 24, 2018 11:31
Behavior of PHP serialize() and unserialize()

Observations

  • Can control the properties to be serialized, by returning an list of property names in _sleep() magic method
  • Private properties are serialized either
  • Was not able to find a way how to decode "\x{ABCD}" unicode escape sequence
unserialize('O:3:"Foo":2:{s:6:"pubVar";i:1;s:11:"\x00Foo\x00priVar";i:2;}');
// PHP error:  unserialize(): Error at offset 47 of 60 bytes on line 1

Serialize an Object

@appkr
appkr / summary.md
Last active August 1, 2019 02:41
์—”ํ„ฐํ”„๋ผ์ด์ฆˆ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์•„ํ‚คํ…์ฒ˜ ํŒจํ„ด by ๋งˆํ‹ด ํŒŒ์šธ๋Ÿฌ

์„œ๋ฌธ

  • ํŒจํ„ด์€ ๋ฐ˜๋ณต์ ์ธ ๋ฌธ์ œ์— ๋Œ€ํ•œ ๊ณตํ†ต์ ์ธ ํ•ด๊ฒฐ์ฑ…
  • ํŒจํ„ด์˜ ์ค‘์š”ํ•œ ์—ญํ•  ์ค‘ ํ•˜๋‚˜๋Š” ํ†ต์šฉ๋˜๋Š” ์–ดํœ˜๋ฅผ ์ •์˜ํ•˜๋Š” ๊ฒƒ

Chapter 1 ๊ณ„์ธตํ™” Layering

  • Presentation
  • Domain
@appkr
appkr / result.md
Last active April 16, 2022 06:01
Performance Comparison for Dynamically-typed Non-compile Languages

Test Result

Language Execution time(sec)
JS with V8 (Node 8.11) 3.18
PHP 7.2 28.026075124741
PHP 7.0 28.537676095963
Ruby 2.5 37.355172
Python 2.7 70.2023770809
Python 3.6 99.59470009803772
@appkr
appkr / csharp.md
Created October 29, 2018 07:33
C# Hello World on Mac

Dev Env

$ brew install mono
$ mono --version
# Mono JIT compiler version 5.14.0.177 (tarball Sun Aug 19 14:22:34 BST 2018)

Programming

@appkr
appkr / java.md
Created October 30, 2018 07:28
Java Hello World on Mac

Dev Env

$ brew cask install java8
$ java -version
# java version "1.8.0_162"

Programming

@appkr
appkr / til_sequel_pro.md
Last active October 31, 2018 01:12
TIL Sequel Pro์—์„œ ํ•œ๊ธ€์ด ๋ฌผ์Œํ‘œ๋กœ ํ‘œ์‹œ๋  ๋•Œ

Sequel Pro Preference(Cmd + ,) > General > Default Encoding ์„ auto์—์„œ UTF-8 Unicode BMP (utf8)์œผ๋กœ ๋ณ€๊ฒฝ

@appkr
appkr / region_code.md
Last active November 1, 2018 03:22
๋Œ€ํ•œ๋ฏผ๊ตญ ํ–‰์ • ๊ตฌ์—ญ ์ฝ”๋“œ
  • (๋ฒ•์ •๋™)์„œ์šธํŠน๋ณ„์‹œ ์ข…๋กœ๊ตฌ ํ‰๋™ 1111017700

    • ์„œ์šธํŠน๋ณ„์‹œ 11
    • ์ข…๋กœ๊ตฌ 110
    • ํ‰๋™ 17700
  • (ํ–‰์ •๋™)์„œ์šธํŠน๋ณ„์‹œ ์ข…๋กœ๊ตฌ ๊ต๋‚จ๋™ 1111058000

    • ์„œ์šธํŠน๋ณ„์‹œ 11
    • ์ข…๋กœ๊ตฌ 110
    • ๊ต๋‚จ๋™ 58000
@appkr
appkr / docker.md
Last active November 20, 2018 08:00
Docker cheatsheet

Export and Import images

# @ source machine

$ docker images | grep foo
# foo            latest              71614adf3b2d        2 months ago        649MB
 
 
$ docker save foo > foo.tar