Skip to content

Instantly share code, notes, and snippets.

View namenu's full-sized avatar
🧑‍🌾

Hyunwoo Nam namenu

🧑‍🌾
View GitHub Profile
@namenu
namenu / vega-viz.json
Created May 2, 2023 06:09
Vega/Vega-Lite viz; To load go to https://vega.github.io/editor
This file has been truncated, but you can view the full file.
{"width":617.394002863118,"height":537.000195611266,"data":{"values":[{"type":"Feature","properties":{"adm_nm":"서울특별시 종로구 사직동","temp":"종로구 사직동","adm_cd":"1101053","adm_cd8":"11010530","sgg":"11110","sidonm":"서울특별시","sido":"11","OBJECTID":1,"adm_cd2":"1111053000","sggnm":"종로구"},"geometry":{"type":"MultiPolygon","coordinates":[[[[126.97688884274817,37.575650779448786],[126.9770344988775,37.56919453005455],[126.97597472821249,37.56933629942577],[126.97537470991254,37.56931556702156],[126.97433193562325,37.56926180051753],[126.96904837001854,37.56819441770833],[126.96854493603384,37.56842767961275],[126.9666499598212,37.56949165520658],[126.96628175024485,37.569700734798694],[126.9660973270804,37.56985650972371],[126.96572852922577,37.570183936115114],[126.96592699822128,37.570318805686206],[126.96601094018429,37.57154839557747],[126.96365922052196,37.57517466066037],[126.9630860043451,37.57648592001554],[126.96284099051198,37.57666158609274],[126.96281041047263,37.57944880965677],[126.96742431584332,37.579601537
(ns scratchpad.relay-protocol)
(defprotocol Connection
(next-page [_ opts])
(previous-page [_ opts])
(has-next-page [_ opts])
(has-previous-page [_ opts]))
(defn vector->Connection [v]
@namenu
namenu / Resx.res
Created January 17, 2022 15:02
Resx proposal
module Array = {
let map = (xs: array<'a>, f: 'a => React.element): React.element => {
Belt.Array.map(xs, f)->React.array
}
let mapWithIndex = (xs: array<'a>, f: (int, 'a) => React.element): React.element => {
Belt.Array.mapWithIndex(xs, f)->React.array
}
}
@namenu
namenu / 390.re
Last active November 3, 2020 15:22
Reason Dojo
let partition_by_identity = xs => {
let rec impl = (xs, cur) => {
switch (xs, cur) {
| ([], _) => [cur]
| ([x, ...xs], []) => impl(xs, [x])
| ([x, ...xs], [y, ..._]) =>
if (x == y) {
impl(xs, [x, ...cur]);
} else {
[cur, ...impl(xs, [x])];
@namenu
namenu / qual-salary.json
Last active June 9, 2020 05:57
Stack Overflow survey
[{"lang":"PHP","average-years":6.757539410555175,"median-salary":44880.52568697726,"count":2918,"year":2017},{"lang":"F#","average-years":9.78834355828221,"median-salary":74250.0,"count":163,"year":2017},{"lang":"Python","average-years":7.105820105820106,"median-salary":61505.37634408607,"count":3213,"year":2017},{"lang":"Objective-C","average-years":7.767682926829268,"median-salary":60411.29032258062,"count":820,"year":2017},{"lang":"Scala","average-years":7.619961612284069,"median-salary":66000.0,"count":521,"year":2017},{"lang":"Ruby","average-years":7.178540772532189,"median-salary":68333.33333333331,"count":1165,"year":2017},{"lang":"Rust","average-years":7.069565217391304,"median-salary":73333.33333333337,"count":115,"year":2017},{"lang":"JavaScript","average-years":7.470875048758289,"median-salary":56774.19354838705,"count":7691,"year":2017},{"lang":"Swift","average-years":7.136734693877551,"median-salary":60500.00000000001,"count":735,"year":2017},{"lang":"R","average-years":7.33659217877095,"median-s
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@namenu
namenu / Chap8.idr
Last active February 26, 2020 13:09
tdd-idris
import Vector
-- 8.3
total
headUnequal : DecEq a => {xs : Vector n a} -> {ys : Vector n a} ->
(contra : (x = y) -> Void) -> ((x::xs) = (y::ys)) -> Void
headUnequal contra Refl = contra Refl
total
(ns interval-tree
(:require [clojure.spec.alpha :as s]))
;; augmented 1-D interval tree
(defrecord ^:private Node [interval highest left right])
(defn insert [{:keys [interval highest left right] :as tree} [vlow vhigh :as value]]
(if (nil? tree)
(Node. value vhigh nil nil)
@namenu
namenu / keybase.md
Created July 2, 2019 17:58
keybase.md

Keybase proof

I hereby claim:

  • I am namenu on github.
  • I am namenu (https://keybase.io/namenu) on keybase.
  • I have a public key whose fingerprint is 50BA 7CF6 A83C A23B 15B8 39CC EA0C 0066 44CC EE7C

To claim this, I am signing this object:

@namenu
namenu / ListReverse.js
Created September 6, 2018 17:14
Reverse a linked list
// Q. Reverse a linked list.
// What is linked list?
const cons = h => t => f => f(h)(t)
// What is boolean?
const T = a => b => a
const F = a => b => b
// What is integer?