As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
/* | |
* This work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License, Version 2, | |
* as published by Sam Hocevar. See the COPYING file for more details. | |
*/ | |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { |
var p1 = { | |
x: 20, | |
y: 20 | |
}; | |
var p2 = { | |
x: 40, | |
y: 40 | |
}; |
(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.
SSH_ENV=$HOME/.ssh/environment | |
# start the ssh-agent | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
# spawn ssh-agent | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null |
var string_to_slug = function (str) | |
{ | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;"; | |
var to = "aaaaeeeeiiiioooouuuuncescrzyuudtn------"; | |
for (var i=0, l=from.length ; i<l ; i++) |
// Unfortunatelly it stopped working in F# 4.1 after this PR https://github.com/Microsoft/visualfsharp/pull/1650 | |
// Will ask to revert it | |
type FoldArgs<'t> = FoldArgs of ('t -> 't -> 't) | |
let inline foldArgs f (x:'t) (y:'t) :'rest = (FoldArgs f $ Unchecked.defaultof<'rest>) x y | |
type FoldArgs<'t> with | |
static member inline ($) (FoldArgs f, _:'t-> 'rest) = fun (a:'t) -> f a >> foldArgs f | |
static member ($) (FoldArgs f, _:'t ) = f |
[<Struct>] | |
type OptionalBuilder = | |
member __.Bind(opt, binder) = | |
match opt with | |
| Some value -> binder value | |
| None -> None | |
member __.Return(value) = | |
Some value | |
let optional = OptionalBuilder() |
module Main | |
import Data.Vect | |
exists : {k : Type} -> (k -> Type) -> Type | |
exists t = (b : Type) -> ({a : _} -> t a -> b) -> b | |
packExists : {k : Type} -> {t : k -> Type} -> {a : k} -> t a -> exists t | |
packExists x = \b, f => f x |
type Head<T extends unknown[]> = T[0]; | |
type FnWithArgs<T extends unknown[]> = (...args: T) => void; | |
type TailArgs<T> = T extends (x: unknown, ...args: infer T) => unknown ? T : never; | |
type Tail<T extends unknown[]> = TailArgs<FnWithArgs<T>>; | |
// Lol | |
type Decr<T extends number> = | |
T extends 10 ? 9 : | |
T extends 9 ? 8 : |