This file contains 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
import * as t from 'io-ts' | |
import dayjs, { Dayjs } from 'dayjs' | |
import { pipe } from 'fp-ts/lib/function' | |
import { chain } from 'fp-ts/lib/Either' | |
import customParseFormat from 'dayjs/plugin/customParseFormat' | |
dayjs.extend(customParseFormat) | |
export const isoDate = new t.Type<Dayjs, string, unknown>( | |
'isoDate', | |
(u): u is Dayjs => dayjs.isDayjs(u), |
This file contains 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
<head> | |
<script | |
src="https://cdnjs.cloudflare.com/ajax/libs/react/17.0.2/umd/react.production.min.js" | |
type="application/javascript" | |
></script> | |
<script | |
src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.production.min.js" | |
type="application/javascript" | |
></script> | |
<script> |
This file contains 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
{ | |
"version": "0.0.13", | |
"browserslist": [ | |
"last 2 chrome versions", | |
"last 2 firefox versions", | |
"last 1 safari versions" | |
], | |
"dependencies": { | |
"@fortawesome/fontawesome-svg-core": "^1.2.30", | |
"@fortawesome/free-solid-svg-icons": "^5.14.0", |
This file contains 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
// To see it in action https://xstate.js.org/viz/ | |
// Since this snippet isn't functioning on its own, turn off some rules | |
/* eslint-disable new-cap, @typescript-eslint/ban-ts-comment */ | |
// @ts-nocheck | |
Machine({ | |
id: 'starting', | |
initial: 'starting', | |
states: { | |
build: { |
This file contains 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
npx -p sast sast-parse ../../color-contrast-matrix/src/App.scss -f=yaml -WP |
This file contains 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', |
This file contains 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 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 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 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) = |
NewerOlder