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 twistUp = (str) => { | |
const lookup = { | |
'a': 'áăắặằẳẵǎâấậầẩẫäạàảāąåǻãɑɐɒ', | |
'b': 'ḅɓß♭␢Б', | |
'c': 'ćčçĉɕċ', | |
'd': 'ďḓḍɗḏđɖ', | |
'e': 'éĕěêếệềểễëėẹèẻēęẽɘəɚ', | |
'f': 'ƒſʃʆʅɟʄ', | |
'g': 'ǵğǧģĝġɠḡɡ', | |
'h': 'ḫĥḥɦẖħɧ', |
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 src = ` | |
var a = 1; | |
var b:string = '123' | |
interface User { | |
name: string | |
} | |
`; | |
const getDataBetweenChars = (start, end, data) => { | |
const lines = cleanArray(data.split('\n')) |
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 Left = function(x) { | |
this.__value = x; | |
}; | |
Left.of = function(x) { | |
return new Left(x); | |
}; | |
Left.prototype.map = function(f) { | |
return this; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<style> | |
.Form--search-input { | |
-webkit-box-sizing: border-box; |
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 kofta = function(func) { | |
const OrEqualTo = (func, x, y) => func(x, y) || Equals(x, y); | |
const GreaterThan = (x, y) => x > y; | |
const Equals = (x, y) => x === y; | |
const True = (x) => Equals(x, true); | |
const Null = (n) => Equals(n, null); | |
const Maybe = (bool, func) => !!bool ? func() : undefined; | |
const MaybeOrElse = (bool, m, e) => Maybe(bool, m) || Maybe(!bool, e) | |
const handle = function(func) { |
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 _string = (v) => typeof v === "string" | |
const _none = (v) => v === undefined || v === null; | |
function string(target, name, desc) { | |
return createNewDescriptor("string", _string).apply(null, arguments); | |
} | |
function none(target, name, desc) { | |
return createNewDescriptor("undefined", _none).apply(null, arguments); | |
} |
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
class ValidationInstance | |
constructor: (@item, @rules...) -> | |
class Validation | |
flatten = (arr) -> | |
merged = []; | |
merged.concat.apply(merged, arr); | |
_toValidate = null | |
instances = [] | |
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
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document) | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn) | |
} | |
NodeList.prototype.__proto__ = Array.prototype |
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
Function.prototype.curry = function(){ | |
var length = getParamNames(this); //get arguments length | |
if(arguments.length === length){ //if all the arguments are provided | |
return this.apply(null, arguments); //call itself with the provided arguments | |
} else { // if not enough arguments provided | |
var outterArgs = argumentsToArray(arguments); //convert the argument 'array-like object' into a real array | |
return cacheOutterArguments(outterArgs, this); //cache the arguments in a function, | |
//pass original 'this' and return a new function | |
} |
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
function fib(prev=[], loop=100, cb=function(){}) { | |
if(!prev.length){ | |
prev.unshift(0); | |
prev.unshift(1); | |
} | |
prev.unshift(prev[1] + prev[0]); | |
cb(prev); | |
if(loop === 0){ | |
return prev; |