This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let auth = { | |
initial: 'login_screen', | |
states: { | |
login_screen: { | |
on: { | |
NAVIGATE_REGISTER_SCREEN: 'register_screen' | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let splash = { | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
LOAD_DATA: 'spinner', | |
}, | |
}, | |
spinner: { | |
type: 'final', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open ReactUpdate; | |
type context = { | |
rate: int, | |
comment: string, | |
}; | |
type action = | |
| Open | |
| Close |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type windowSize = { | |
height: int, | |
width: int, | |
}; | |
let useWindowResize = () => { | |
let getWindowSize = (): option(windowSize) => | |
switch ([%external window]) { | |
| None => None | |
| Some(w) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |