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 Main exposing (..) | |
| import Char | |
| import Set | |
| import Html exposing (Html, pre, text, div, h1, img, button, span) | |
| import Html.Attributes exposing (src) | |
| import Html.Events exposing (onClick) | |
| ---- MODEL ---- |
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
| // Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE | |
| import * as Block from "stdlib/block"; | |
| import * Belt_Array from "stdlib/belt_Array"; | |
| function depthFirstTraversal(param) { | |
| if (typeof param === "number") { | |
| return /* array */[]; | |
| } else if (param.tag) { | |
| var match = param[0]; |
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 Main where | |
| import Prelude | |
| data Tree a = Empty | Leaf a | Node a (Tree a) (Tree a) | |
| depthFirstTraversal x = | |
| case x of | |
| Empty -> [] | |
| Leaf a -> [a] |
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 range: (int, int) => array(int) = [%bs.raw | |
| (a, b) => {j| | |
| const ranger = {}; | |
| ranger[Symbol.iterator] = function* () { | |
| let current = a; | |
| while (a <= b) { | |
| yield a++; | |
| } | |
| } |
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
| rebuild_restart () { | |
| if [ -n "$1" ] | |
| then | |
| echo "Rebuilding and restarting $@" | |
| docker-compose up --build --no-deps -d "$@" | |
| else | |
| echo "You need a container name (e.g. rebuild_restart my-container other-container)" | |
| fi | |
| } |
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 Microsoft.FSharp.Reflection | |
| open Newtonsoft.Json | |
| open System | |
| /// F# options-converter | |
| type OptionConverter() = | |
| inherit JsonConverter() | |
| override __.CanConvert t = t.IsGenericType && typedefof<option<_>>.Equals(t.GetGenericTypeDefinition()) | |
| override __.WriteJson(writer, value, serializer) = |
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 Csv | |
| // Transliterated from https://stackoverflow.com/a/4685745/1924257 | |
| module private Internals = | |
| let quote = "\"" | |
| let escapedQuote = "\\\"" | |
| let delimiter = "\t" | |
| let escapedCharacters = ['\t'; '\n'] |> Set.ofList |
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
| use colored::*; | |
| use futures::{future, Future}; | |
| use hyper::header::{HeaderName, HeaderValue}; | |
| use hyper::service::service_fn; | |
| use hyper::{Body, Request, Response, Server}; | |
| use hyper::{Method, StatusCode}; | |
| use lazy_static::lazy_static; | |
| use maplit::btreemap; | |
| use std::collections::BTreeMap; | |
| use std::path::Path; |
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
| // https://github.com/vuejs-tips/tiny-debounce/blob/master/index.js | |
| function debounce(fn, delay) { | |
| let timeoutID = null; | |
| return (...args) => { | |
| clearTimeout(timeoutID); | |
| timeoutID = setTimeout(() => { | |
| fn(...args) | |
| }, delay); | |
| } | |
| } |
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
| "use strict"; | |
| // Typescript 3.5.2 | |
| var __importDefault = (this && this.__importDefault) || function (mod) { | |
| return (mod && mod.__esModule) ? mod : { "default": mod }; | |
| }; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| const lodash_1 = __importDefault(require("lodash")); | |
| function Err(value) { | |
| return { | |
| kind: 'error', |