Skip to content

Instantly share code, notes, and snippets.

View eunmin's full-sized avatar
🐦
Hello!

Eunmin Kim eunmin

🐦
Hello!
View GitHub Profile
@eunmin
eunmin / di-in-fp.md
Created January 7, 2019 03:14 — forked from gvolpe/di-in-fp.md
Dependency Injection in Functional Programming

Dependency Injection in Functional Programming

There exist several DI frameworks / libraries in the Scala ecosystem. But the more functional code you write the more you'll realize there's no need to use any of them.

A few of the most claimed benefits are the following:

  • Dependency Injection.
  • Life cycle management.
  • Dependency graph rewriting.
@eunmin
eunmin / swift-json-to-object.swift
Created July 21, 2018 12:43
swift json to object
import Foundation
let url = URL(string: "http://webtoon.daum.net/data/pc/webtoon/list_daily_ranking/serialized?pageSize=5&timeStamp=1531916119497")
struct Ranking : Decodable {
let title : String
}
struct Webtoon : Decodable {
let data: [Ranking]
@eunmin
eunmin / swfit-json.swift
Created July 18, 2018 12:31
Swfit JSON Example
import Foundation
let url = URL(string: "http://webtoon.daum.net/data/pc/webtoon/list_daily_ranking/serialized?pageSize=5&timeStamp=1531916119497")
let data = try! Data(contentsOf: url!)
let webtoon = try JSONSerialization.jsonObject(with: data, options: []) as! NSDictionary
for item in webtoon["data"] as! NSArray {
let ranking = item as! NSDictionary
@eunmin
eunmin / hello.clj
Last active December 31, 2017 04:38
(ns example.hello)
(def a 1)
(defn add [x y]
(+ x y))
@eunmin
eunmin / Main.elm
Created August 25, 2017 12:30
Elm Union Types
type JsonValue
= JsonString String
| JsonNumber Int
| JsonNull
| JsonArray List JsonValue
| JsonObject Dict String JsonValue
user : Dict String JsonValue
user =
Dict.fromList [ ( "name"
@eunmin
eunmin / cider-load-buffer-all-connections.el
Created June 17, 2017 10:39
cider load buffer all connections
(defun cider-load-buffer-all-connections ()
(let ((curr (cider-current-connection)))
(dolist (conn cider-connections)
(cider-make-connection-default conn)
(cider-load-buffer))
(cider-make-connection-default curr)))