Skip to content

Instantly share code, notes, and snippets.

View therockstorm's full-sized avatar
😎

Rocky Warren therockstorm

😎
View GitHub Profile
CREATE TABLE IF NOT EXISTS search_idx
(
id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
key_str TEXT NOT NULL,
val_str TEXT NOT NULL,
val_int INT,
val_date TIMESTAMPTZ
);
CREATE INDEX search_idx_key_str_idx ON search_idx
query {
search(query: "user:therockstorm language:Scala", type: REPOSITORY, first: 10) {
repositoryCount
edges {
node {
... on Repository {
nameWithOwner
protov: object(expression: "master:README.md") {
... on Blob {
text
day knowledge
1 10
2 8
3 0
4 4
5 2
6 4
7 5
@therockstorm
therockstorm / reporter.ts
Created October 17, 2019 13:32
io-ts error reporter
import { pipe } from "fp-ts/lib/pipeable"
import { last } from "fp-ts/lib/Array"
import { Either, left, right, fold as foldE } from "fp-ts/lib/Either"
import { fold as foldO } from "fp-ts/lib/Option"
import {
ContextEntry,
Errors,
getFunctionName,
Type,
Validation,