" Plugins (using vim-plug) | |
call plug#begin('~/.config/nvim/plugins') | |
" Core Madlib | |
Plug 'madlib/vim-madlib' | |
" Commentary | |
Plug 'tpope/vim-commentary' |
const CC = require('change-case') | |
const { | |
join, | |
__: $, | |
fromPairs, | |
toPairs, | |
slice, | |
sortWith, | |
descend, | |
keys, |
import type {Maybe} from "Maybe" | |
import {Just, Nothing} from "Maybe" | |
alias Predicate a = a -> Boolean | |
alias Transform a b = a -> b | |
alias PredicateTransformer a b = #[Predicate a, Transform a b] | |
cond :: List (PredicateTransformer a b) -> a -> Maybe b | |
export cond = (predlist, x) => pipe( | |
where { |
I hereby claim:
- I am brekk on github.
- I am brekk (https://keybase.io/brekk) on keybase.
- I have a public key ASDovb8gcCJghu48fqn1-p9wbkxYDI8yvfNGPCfxdK1qBAo
To claim this, I am signing this object:
I would like to write today about a personal tool I've written and maintained for the past few years, called snang
.
Depending on your frame of reference, you can think of it as a tool similar to sed(1)
or awk(1)
. If you're more familiar with the node ecosystem, snang
was inspired by both jayin
and pipeable-js
, but is designed to be a more re-usable solution.
If you're unfamiliar with anything at all, then this might not be the right document for you; suffice it to say that you can use snang
to cut apart files and streams using a JS-based sandbox.
const fs = require('fs') | |
const path = require('path') | |
const sharp = require('sharp') | |
const globby = require('globby') | |
const { trace } = require('xtrace') | |
const { futurizeWithCancel, tacit } = require('ensorcel') | |
const { parallel, fork: rawFork, Future, chain } = require('fluture') | |
const { reduce, mergeRight, objOf, pipe, curryN, __: $, map } = require('ramda') | |
const yargsParser = require('yargs-parser') | |
const { writeFile, copyFile } = require('torpor') |
This codebase uses a functional programming (FP) approach and ideology. For anything which cannot be automatically linted for and resolved automatically, this document will be used to frame conventions used within the code and their rationale.
Use ramda for function composition, data transformation, higher-order functions and automatically curried interface. It is well tested, offers more functions than you will likely ever need to use, but has a core set of very clean utililty functions.
See converter for a good example of potential usage.
import {map} from 'ramda' | |
const inputs = '54321'.split('') | |
const results = map(parseInt, inputs) | |
// const parseInts = map(parseInt) | |
// const results = parseInts(inputs) |
import { curry, pathOr, pipe, toPairs, map } from 'ramda'; | |
const prepend = curry((b, a) => a + b); | |
const nestedInfData = curry((inf, what, label, propPath) => | |
pipe( | |
pathOr('', [what, ...propPath]), | |
prepend(label + ': ') | |
)(inf) | |
); | |
const renderableLi = curry((fn, key, access) => ( |