Skip to content

Instantly share code, notes, and snippets.

View coleea's full-sized avatar
💭
I may be slow to respond.

Mario KB coleea

💭
I may be slow to respond.
View GitHub Profile
@raveclassic
raveclassic / form.ts
Created September 26, 2019 15:34
form test
import { OutputOf, string, type, Type, TypeOf, Validation } from 'io-ts';
import React, { FC, useState } from 'react';
import { either, left, map, right } from 'fp-ts/lib/Either';
import { sequenceS } from 'fp-ts/lib/Apply';
import { NumberFromString } from 'io-ts-types/lib/NumberFromString';
import { pipe } from 'fp-ts/lib/pipeable';
const formDataCodec = type({
age: NumberFromString,
password: string,
@UndoneKittens
UndoneKittens / eamuse_djdata_score_parser.js
Last active July 11, 2018 09:56 — forked from McMaNGOS/eamuse_djdata_score_parser.js
eAmusement beatmania IIDX DJ DATA scores -> JSON
/* Cheerio-powered parser for the DJ DATA score page on the beatmania IIDX website.
Requires 'cheerio', 'request', and 'iconv' packages.
Needs 'Cookie' header from manual login for authentication.
Results in an array of JSON-formatted scores, which looks like this:
{
"songs": [{
"song": {
"name": "SONG NAME",
@gcanti
gcanti / fp-ts-technical-overview.md
Last active March 11, 2024 02:40
fp-ts technical overview

Technical overview

A basic Option type

// Option.ts

// definition
export class None {
  readonly tag: 'None' = 'None'
@DrBoolean
DrBoolean / free-er.js
Last active March 17, 2024 10:33
Free(er) monads in JS (pt 1)
const daggy = require('daggy')
const compose = (f, g) => x => f(g(x))
const id = x => x
const kleisli_comp = (f, g) => x => f(x).chain(g)
//=============FREE=============
const Free = daggy.taggedSum({Impure: ['x', 'f'], Pure: ['x']})
const {Impure, Pure} = Free
@JPGygax68
JPGygax68 / consume-ffmpeg-libs.cmake
Last active November 23, 2024 15:21
#CMake: how to add the #FFmpeg libraries to a target
# Detect architecture
if (CMAKE_SIZEOF_VOID_P MATCHES 8)
set( PROJECT_ARCH "x86_64" )
else(CMAKE_SIZEOF_VOID_P MATCHES 8)
set( PROJECT_ARCH "x86" )
endif(CMAKE_SIZEOF_VOID_P MATCHES 8)
# FFmpeg
@nicolashery
nicolashery / rxjs-react.js
Last active August 1, 2022 03:36
Fetching data asynchronously with RxJS and React
import React from 'react';
import _ from 'lodash';
import Rx from 'rx';
import superagent from 'superagent';
let api = {
host: 'http//localhost:3001',
getData(query, cb) {
superagent