Skip to content

Instantly share code, notes, and snippets.

View ryuheechul's full-sized avatar
💻
hacking on projects!

Heechul Ryu ryuheechul

💻
hacking on projects!
View GitHub Profile
@ryuheechul
ryuheechul / Reason-Option-Iterop-Issue.md
Last active September 4, 2018 15:00
Attempts to make a reason function work in JS

I wanted to make an npm module via ReasonML

  • a function need to accept objects
  • but couldn't find a way to convert an JS Object to a Reason Record (holds optional value)
// I wanted to have an npm module function like below
reasonFnExposedToJs({key1: 'blah', key2: undefined})

// and works fine with Reason side but generated argsFromJs looks like below
@ryuheechul
ryuheechul / README.md
Last active June 29, 2018 07:24
FP in Scala exercises in Chapter 2
@ryuheechul
ryuheechul / rainist_holdem_heechul.py
Last active August 17, 2018 06:43
my Rainist holdem function for pycon
from typing import List
from random import randint
from .core.cards import Card
from .player import Me, Other
def bet(
me: Me,
bet_players: List[Other],
@ryuheechul
ryuheechul / READEME.md
Last active October 13, 2018 07:36
Describing an issue with Reason that not processing nested object properly via `jsConverter`

Claim: Difficulty with interop with JS when accepting nested object param from JS to Reason

Reasonml Ver: 3.3.2

  • No problem with taking parameters from JS and matching to any type contains optional with one depth

  • But it seems to lose values wrapped by option if you have more depth like below

@ryuheechul
ryuheechul / FastPipeIssue.re
Last active October 27, 2018 07:20
the case new fast pipe syntax `->` doesn't work after `|>`
/* this works */
"1=2=3"
|> Js.String.split("=")
|. Js.log;
/* this works, too */
"1=2=3"
-> Js.log;
/* but the code below doesn't */
@ryuheechul
ryuheechul / IDEA.md
Last active December 3, 2018 05:45
prctl - Probe and Resource ConTroL (for k8s)

prctl - Probe and Resource ConTroL (for k8s)

Just an Gist idea for now

Why?

  • It's mundane to edit every Deployment in your k8s cluster to have your desired state for Liveness/Readiness Probe and Resources for each container
  • Manaul operations also don't help collaborations of discussions to have right values for the states

How this would be better than manual approach?

  • One(ish) place to read and edit desired states
  • Keep alerting if the state of the container is different than the repository linked
@ryuheechul
ryuheechul / special-number-36.md
Last active January 20, 2019 11:04
Something special about the number 36

I just turned age 36 (by Korean standards) and noticed that some of my friends seem to be sad to have such a "big" number as their age.

So I thought about whether there could be anything special about the number 36 and I found a simple and interesting pattern for that number.

When you divide 36 by 2, the answer is 18 (36 / 2 == 18); and when you multiply each digit of 36 individually, the answer is also 18 (3 * 6 == 18)!

So it seemed kind of special to me and then I wondered if there is any natural number that has these same features (except 0)

As a non-math person, the shocking discovery was that 36 seems to be the only number under 10M.

@ryuheechul
ryuheechul / useful-regexs.md
Last active January 18, 2020 12:20
useful REGEXs
/\bHTTP_(?!HOST\b)(.)+/g

HTTP_HOST // not match
HTTP_NOTHOST // match
HTTP_HOSTS // match
HTTP_hHOST // match
HTTP_HOST_3 // match
@ryuheechul
ryuheechul / 0-Initial-thoughts.md
Created March 31, 2019 06:44
If keytty was made of reactive streams

After a while since I discovered Functional Reactive Programming, I believe this is the way Keytty should be built.

Articles that convinced me

Currently, Keytty is mostly made up with proactive OOP written in Objective C.

There are several issues that I found when I try to maintain the code and add more features. such as:

  • Controller has too many responsibilities and gets more complex over time.
@ryuheechul
ryuheechul / Playground-for-Keytty-streams.md
Last active March 31, 2019 10:05
Playground for Keytty reactive streams