(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
const daggy = require('daggy') | |
const Task = require('data.task') | |
const _ = require('lodash') | |
const kleisli_comp = (f, g) => x => f(x).chain(g) | |
const compose = (f, g) => x => f(g(x)) | |
const id = x => x | |
//=============FREE============= | |
const Free = daggy.taggedSum({Impure: ['x', 'f'], Pure: ['x']}) | |
const {Impure, Pure} = Free |
const daggy = require('daggy') | |
const compose = (f, g) => x => f(g(x)) | |
const id = x => x | |
//===============Define Coyoneda========= | |
const Coyoneda = daggy.tagged('x', 'f') | |
Coyoneda.prototype.map = function(f) { | |
return Coyoneda(this.x, compose(f, this.f)) | |
} |
#!/usr/bin/env bash | |
# Browse Ramda documentation in Terminal | |
# Requires jq and a tool such as fzf or peco for interactive filtering | |
LATEST="http://raine.github.io/ramda-json-docs/latest.json" | |
DOCS_URL="http://ramdajs.com/docs/" | |
json=$(curl -s $LATEST) | |
functions=$(echo "$json" | jq -r '.[] | if .sig and (.sig | length > 0) then .name + " :: " + .sig else .name end') |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
##git mergetool
In the middle file (future merged file), you can navigate between conflicts with ]c
and [c
.
Choose which version you want to keep with :diffget //2
or :diffget //3
(the //2
and //3
are unique identifiers for the target/master copy and the merge/branch copy file names).
:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a | |
function! s:align() | |
let p = '^\s*|\s.*\s|\s*$' | |
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) | |
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) | |
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) | |
Tabularize/|/l1 | |
normal! 0 | |
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) |