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
-- 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
@broerjuang
broerjuang / useWindowResize.re
Created September 23, 2019 06:51
Custom Hooks
type windowSize = {
height: int,
width: int,
};
let useWindowResize = () => {
let getWindowSize = (): option(windowSize) =>
switch ([%external window]) {
| None => None
| Some(w) =>
@broerjuang
broerjuang / feedback_form.re
Created September 15, 2019 19:15
An experiment using state machine using ReasonML
open ReactUpdate;
type context = {
rate: int,
comment: string,
};
type action =
| Open
| Close
@broerjuang
broerjuang / machine.js
Created September 15, 2019 06:29
Generated by XState Viz: https://xstate.js.org/viz
let splash = {
initial: 'idle',
states: {
idle: {
on: {
LOAD_DATA: 'spinner',
},
},
spinner: {
type: 'final',
@broerjuang
broerjuang / machine.js
Last active August 25, 2019 19:16
Generated by XState Viz: https://xstate.js.org/viz
let auth = {
initial: 'login_screen',
states: {
login_screen: {
on: {
NAVIGATE_REGISTER_SCREEN: 'register_screen'
}
},
@broerjuang
broerjuang / courses.md
Last active August 7, 2019 11:20
research
module SharedTypes = {
type search = list((string, string));
type path = list(string);
type body = Js.Json.t;
type params = {
search: option(search),
path: option(path),
body: option(body),
let rubel_apps = {
initial: 'payment_page',
states: {
payment_page: {
on: {
VISIT: 'payment_information_page',
},
},
payment_information_page: {
on: {

Ruangguru Dashboard Plugin

alt text

Rationale

We have bunch of dashboard projects which aim to be a support for our business. The dashboard comes with varied purposes. For example, content designed to upload a video and text content inside ruang belajar. Video Review is design to get fast feedback loop for ruangbelajar video.

We might support another needs. But tracking url can be problematic. First, we need to remember url and sometimes we don't have convention about naming the url. Second, we might end up have dozens of dashboard. Having multiple tabs inside the browser without integration system might also be problematic.

@broerjuang
broerjuang / countries.json
Last active May 21, 2019 08:19
Countries
[
{"label": "Afghanistan", "value": "af"},
{"label": "Åland Islands", "value": "ax"},
{"label": "Albania", "value": "al"},
{"label": "Algeria", "value": "dz"},
{"label": "American Samoa", "value": "as"},
{"label": "AndorrA", "value": "ad"},
{"label": "Angola", "value": "ao"},
{"label": "Anguilla", "value": "ai"},
{"label": "Antarctica", "value": "aq"},