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
var __extends = this.__extends || function (d, b) { | |
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | |
function __() { this.constructor = d; } | |
__.prototype = b.prototype; | |
d.prototype = new __(); | |
}; | |
var Immutable = (function () { | |
function Immutable() { | |
this.objectString = "object"; | |
} |
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> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script> | |
window.xinj = function(obj) { | |
debugger; |
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
let createGroupings lineSeq = | |
lineSeq |> Seq.map (fun element -> element.[0]) | |
|> Seq.countBy id | |
|> Seq.toList | |
let list = ["asd"; "dsa"] | |
createGroupings list |
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
window.Bus = function(name, funcs, parent) { | |
funcs = funcs instanceof Array === true ? funcs : [funcs]; | |
var bus = {}; | |
var sub = new ko.subscribable(); | |
var functionType = "function"; | |
bus.name = name; | |
bus.children = []; | |
bus.previousMessages = []; | |
bus.extend = function(name, funcs) { | |
var childBus = window.Bus(name, funcs, bus); |
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> | |
<script src="//code.jquery.com/jquery.min.js"></script> | |
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/knockout/3.0.0/knockout-min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> |
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
var reverseForEach = function(arr, fun) { | |
for (var i = arr.length - 1; i > -1; --i) { | |
fun(arr[i], i, arr); | |
} | |
} | |
var compose = function() { | |
var funcs = Object.keys(arguments); | |
var outterArgs = arguments; | |
return 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
var chainedAndFuncs = []; | |
var chainedOrFuncs = []; | |
var lastIntentEnum = { | |
none: 0, | |
and: 1, | |
or: 2 | |
}; | |
var lastChainedIntent = lastIntentEnum.none; | |
var convertArgumentsToArray = function(args) { |
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
var biker = { | |
parse: function(template) { | |
var rightCurly = "{"; | |
var leftCurly = "}"; | |
var cleanArray = function(x) { | |
return x; | |
}; | |
var splitLeftCurly = function(x) { | |
var s = x.split(leftCurly)[0]; | |
return s; |
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
var fizzBuzzKata = function() { | |
var limit = 100; | |
var mod = function(mod, value){ | |
return (mod && value) ? value % mod === 0 : value; | |
}; | |
var modFifteen = function(i){return mod(15, i);}; | |
var modFive = function(i){return mod(5, i);}; | |
var modThree = function(i){return mod(3, i);}; | |
var fizzBuzz = function(){console.log("Fizz Buzz");}; | |
var buzz = function(){console.log("Buzz");}; |
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 fizzBuzz(limit, logger, value){ | |
value = value || 1; | |
var logged = false; | |
if(shouldLog(mod(value, 15), logged)){ | |
logger("FizzBuzz"); | |
setLogged(); | |
} else if(shouldLog(mod(value, 5), logged)){ | |
logger("Buzz"); | |
setLogged(); |