This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(set-macro-character #\[ | |
(lambda (stream char) | |
(declare (ignore char)) | |
(let ((result (read-delimited-list #\] stream t))) | |
`(,@result)))) | |
(set-macro-character #\] | |
(lambda (stream char) | |
(declare (ignore stream char)) | |
(error "Unmatched closing bracket: ]"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defgeneric _fmap (x f)) | |
(defmacro fmap (f x) | |
`(_fmap ,x #',f)) | |
(defmethod _fmap ((x number) f) | |
(funcall f x)) | |
(defmethod _fmap ((x string) f) | |
(funcall f x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin lineClamp ($lines) { | |
overflow: hidden; | |
display: -webkit-box; | |
-webkit-box-orient: vertical; | |
-webkit-line-clamp: $lines; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type COMPOSE = <T>(fn1: (a: T) => T, ...fns: Array<(a: T) => T>) => | |
(a: T) => T | |
export const compose: COMPOSE = (fn1, ...fns) => | |
fns.reduce( | |
(prevFn, nextFn) => | |
(value) => prevFn(nextFn(value)), | |
fn1 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"console.log": { | |
"scope": "javascript,typescript", | |
"prefix": "log", | |
"body": [ | |
"console.log($1)", | |
], | |
"description": "console.log" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import NextHead from 'next/head'; | |
export const Head = ({ | |
title, | |
image, | |
imageAlt, | |
description, | |
author, | |
keywords, | |
}) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ADT0<T> = [T] | |
type ADT1<T, V> = [T, V] | |
// --------------------------------- | |
type Just<T> = ADT1<'Just:', T> | |
type Nothing = ADT0<'Nothing:'> | |
type Maybe<J> = Nothing | Just<J> | |
// functions | |
const just = <T>(v: T): Maybe<T> => ['Just:', v]; | |
const nothing = <T>():Maybe<T> => ['Nothing:']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/evilsoft/crocks | |
https://github.com/ramda/ramda | |
https://github.com/lodash/lodash/tree/npm/fp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isGreateThan = n => m => (m > n); | |
const square = x => x * x; | |
const filter = f => arr => arr.filter(f); | |
const map = f => arr => arr.map(f); | |
const reduce = f => arr => arr.reduce(f); | |
const includes = v => arr => arr.includes(v); | |
const applyTo = x => f => f(x); | |
const all = f => arr => arr.filter(f).length === arr.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$$\mathbb{N} = \{ 1,2, \dots\}$$ | |
$$\mathbb{Z} = \{ \dots -2, -1, 0, 1,2, \dots\}$$ | |
$$\mathbb{Q} = \{ x | x = \frac{m}{n} | m,n\in \mathbb{N}, n \neq 0\}$$ |
NewerOlder