.data:hover { fill: #B10000; opacity: 1; } /* data = RED */
.datum:hover { fill: #00B100; opacity: 1; } /* datum= GREEN */
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() { | |
var M = this && this.__extends || function() { | |
var a = Object.setPrototypeOf || { | |
__proto__: [] | |
}instanceof Array && function(a, h) { | |
a.__proto__ = h | |
} | |
|| function(a, h) { | |
for (var f in h) | |
h.hasOwnProperty(f) && (a[f] = h[f]) |
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
/** | |
* FAST PACKING / UNPACKING JSON | |
* | |
* If all objects in a collection follows a similar schema, | |
* then there is gain in changing the representation from a dictionary to a simple array. | |
* | |
* It is known results used in database, protocols, in v8 itself with shadow maps and IRL. | |
* | |
* In this example, we expect our final exchange to be equivalent to this literal representation: | |
* [ |
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
/// Hack it ? | |
function sandbox(code) { | |
// Disable private functions not listed in window object | |
var blackList = [ | |
'Function', // avoid using (new Function("code"))(); to get window access | |
'eval', // ... | |
'self', // return window object | |
'window', // ... | |
]; |
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
"use strict"; | |
var [BRA, KET, IDENT] = ['BRA', 'KET', 'IDENT']; | |
function last(arr){ return arr[arr.length -1] }; | |
export default function act(src, prefix){ | |
var tree = src.split('').reduce((tokens, char)=> { | |
if(char==='{'){ | |
tokens.push({type: BRA}); |
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
/* global fetch*/ | |
import {Dis, act} from 'disto'; | |
let {dispatch, register} = new Dis(); | |
function timeout(t){ | |
return new Promise(resolve => | |
setTimeout(()=> resolve(true), t)); | |
} |
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 React from 'react'; | |
export class Sto extends React.Component{ | |
static defaultProps = { | |
store: x => x | |
} | |
state = { | |
value: this.props.store() | |
} | |
dispatch = action => this.setState({ |
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
// murmurhash2 via https://gist.github.com/raycmorgan/588423 | |
export default function doHash(str, seed) { | |
var m = 0x5bd1e995; | |
var r = 24; | |
var h = seed ^ str.length; | |
var length = str.length; | |
var currentIndex = 0; | |
while (length >= 4) { |
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 Helpers { | |
currentHP(db) { return db.PlayerInfo.CurrHP } | |
noCurrentHPGain(db) { return db.PlayerInfo.CurrentHPGain == 0.0 } | |
radiation(db) { return db.PlayerInfo.TotalDamages[5].Value } | |
aidItems(db) { return db.Inventory['48'] } | |
radiationMoreThan(rads) { | |
return db => { | |
this.radiation(db) > rads; | |
}; |
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
/** | |
* @param {Function} fn Function to curry. | |
* @param {Number} lenght of the arguments required to invoke the function. | |
* @returns {Function} The currified function. | |
*/ | |
const curry = (fn, length = fn.length) => function currified(...args) { | |
if (args.length === 0) { | |
return currified; | |
} | |
NewerOlder