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"> | |
<style> | |
html, body { | |
height: 100%; | |
} |
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
// Patch Backbone Model and Collection to have awareness | |
// of current sync state. | |
// Adds an isLoading method and _inFlight count property. | |
// Fires before:sync and after:sync events. | |
// Based on http://tbranyen.com/post/how-to-indicate-backbone-fetch-progress | |
!function() { | |
function onSyncEnd() { | |
-- this._inFlight; | |
this.trigger("after:sync", 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> | |
<style> | |
svg { | |
} | |
rect { | |
fill-opacity: 0.5; |
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 colorScale = d3.scale.category10(); | |
var chart = c3.generate({ | |
bindto: '#bar-chart', | |
data: { | |
x: 'x', | |
columns: [ | |
['x', 'apple', 'banana'], | |
['count', 191, 238], | |
], |
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
/* | |
* Re-usable Less mixins | |
*/ | |
.ellipsis(@width: 100%) { | |
max-width: @width; | |
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
} |
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
['Alfa','Bravo','Charlie','Delta','Echo','Foxtrot','Golf','Hotel','India','Juliett','Kilo','Lima','Mike','November','Oscar','Papa','Quebec','Romeo','Sierra','Tango','Uniform','Victor','Whiskey','X-ray','Yankee','Zulu'] |
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> | |
<canvas id="canvas"></canvas> | |
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 id="jsbin-javascript"> | |
// |
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 getContent(faClass) { | |
var styleSheet = document.styleSheets[1]; | |
var selector = '.' + faClass; | |
var rules = [].filter.call(styleSheet.rules, function(rule) { | |
return rule.selectorText && (rule.selectorText.split('::')[0] === selector) | |
}); | |
if(rules.length > 0) { | |
return rules[0].style.content |
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
// http://stackoverflow.com/q/29747951/2806996 | |
var transducers = require('transducers.js'); | |
var csp = require('js-csp') | |
// Make transducer | |
var xAdd10 = transducers.map(function (x) { | |
return x + 10; | |
}); | |
// Make a channel, using the transducer |