Skip to content

Instantly share code, notes, and snippets.

View broerjuang's full-sized avatar
🏠
Working from home

Juang Wiantoro broerjuang

🏠
Working from home
View GitHub Profile
var analyticsTrackable=function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e,n={};(function(e){function n(e,n){this.browser=e,this.os=n}function t(e,n){function t(e){if(e.length>0){var t=e.split("/"),r=t.length>1?t[1]:"";n(t[0],r)}}for(var r="",i=0;i<e.length;++i){var o=e[i];if(" "===o){for(t(r),r="";" "===e[i];)++i;o=e[i]}if("("===o){t(r),r="";var a="";for(++i;i<e.length&&")"!==(o=e[i]);++i)a+=o;for(var s=a.split(";"),u=0;u<s.length;++u)n(s[u].trim());++i}else" "!==o&&"("!==o&&(r+=o)}t(r)}function r(e){var n={"Windows NT 10.0":"10","Windows NT 6.3":"8.1","Windows NT 6.2":"8","Windows NT 6.1":"7","Windows NT 6.0":"Vista","Windows NT 5.2":"XP","Windows NT 5.1":"XP","Windows NT 5.0":"2000",10.4:"Tiger",10.5:"Leopard",10.6:"Snow Leopard",10.7:"Lion",10.8:"Mountain Lion",10.9:"Mavericks","10.10":"Yosemite",10.11:"El Capitan",10.12:"Sierra",10.13:"High Sierra",10.14:"Mojave"};function t(e){var t=n[e
{
"monday": [],
"tuesday": [],
"wednesday": [],
"thursday": [
{ "type": "open", "value": 36000 },
{ "type": "close", "value": 64800 }
],
"friday": [{ "type": "open", "value": 36000 }],
"saturday": [
@broerjuang
broerjuang / schedules.json
Last active August 1, 2021 20:52
json of schedules
{
"monday": [],
"tuesday": [
{ "type": "open", "value": 36000 },
{ "type": "close", "value": 64800 }
],
"wednesday": [],
"thursday": [
{ "type": "open", "value": 36000 },
{ "type": "close", "value": 64800 }
@broerjuang
broerjuang / RemoteData.ts
Last active November 30, 2020 13:13
Remote Data module similar to ELM remote data in Typescript
import { useCallback, useState } from "react";
import { isSome, Option, some, none } from "fp-ts/lib/Option";
import { Either, isLeft } from "fp-ts/lib/Either";
type Init = {
readonly _type: "Init";
};
type Loading = {
readonly _type: "Loading";
{
"defaultSeverity": "error",
"rules": {
"array-type": [true, "generic"],
"interface-name": [true, "never-prefix"],
"interface-over-type-literal": false,
"max-classes-per-file": false,
"member-access": [true, "no-public"],
"no-empty": [true, "allow-empty-functions"],
"no-unused-expression": [true, "allow-fast-null-checks"],
module AsyncResult = Relude.AsyncResult;
module Effect = ReludeReact.Effect;
module IO = Relude.IO;
module Option = Relude.Option;
module Reducer = ReludeReact.Reducer;
let (toBusy, completeOk, completeError) =
AsyncResult.(toBusy, completeOk, completeError);
type state('a, 'e) = AsyncResult.t('a, 'e);
Code
@broerjuang
broerjuang / .tmux.conf
Created January 5, 2020 15:19
Tmux config
# vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
@broerjuang
broerjuang / .vimrc
Last active January 5, 2020 15:18
Vim config
" Plugins will be downloaded under the specified directory.
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree'
Plug 'vim-airline/vim-airline'
"Plug 'vim-airline/vim-airline-themes'
Plug 'liuchengxu/space-vim-theme'
"Plugin to insert and delete pair of chars
Plug 'jiangmiao/auto-pairs'
-- We want to prove this:
fmap (compose g f) == compose (fmap g) (fmap f)
-- Fact:
fmap :: (b -> c) -> (a -> b) -> (a -> c)
compose :: (b -> c) -> (a -> b) -> (a -> c)
-- Prove
fmap id f
(\ h g x -> h (g x)) id f