Skip to content

Instantly share code, notes, and snippets.

View basicauth.ts
import * as E from 'fp-ts/Either'
import { pipe } from 'fp-ts/function'
import * as t from 'io-ts'
import { failure } from 'io-ts/PathReporter'
import { toRequestHandler } from 'hyper-ts/lib/express'
import express from 'express'
import * as H from 'hyper-ts'
import * as M from 'hyper-ts/lib/Middleware'
import pgPromise from 'pg-promise'
import * as TE from 'fp-ts/TaskEither'
View todo.g4
grammar todo;
elements
: (element|emptyLine)* EOF
;
element
: '*' ( ' ' | '\t' )* CONTENT NL+
;
View gist:10f3e9c6b4ede867532041112f994506
// works
(http-client/post
"https://api.mixpanel.com/import#past-events"
{:debug true :debug-body true
:basic-auth [mixpanel-api-secret]
:headers {"Accept" "text/plain"
"Content-Type" "application/x-www-form-urlencoded"}
:form-params {:verbose 1
:data json-event-str}
:as :json})
@tecklund
tecklund / index.ts
Created Feb 19, 2021
first crack at lodash to fp-ts conversion
View index.ts
import * as A from 'fp-ts/Array'
import * as Ap from 'fp-ts/Apply'
import * as A1 from 'fp-ts-std/Array'
import * as ROA from 'fp-ts/ReadonlyArray'
import * as NEA from 'fp-ts/NonEmptyArray'
import * as O from 'fp-ts/Option'
import * as Eq from 'fp-ts/Eq'
import * as Ord from 'fp-ts/Ord'
import * as R from 'fp-ts/Record'
import * as _ from 'lodash'