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
/* | |
A widget that will appear when the screen reaches a certain size. Allows opening and closing of a sidebar. | |
100% pure, vanilla JavaScript and CSS. | |
*/ | |
(function(){ | |
var Badge = function(target, placement) { | |
var self = this; | |
this.target = target; | |
this.placement = placement; | |
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 breadOne = {}; | |
breadOne.name = "White"; | |
breadOne.type = "Flour"; | |
//why make vars inside the constructor Bread if I can add more here like this? | |
breadOne.whatever = "another option"; | |
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="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.js"></script> | |
<!-- uncomment for React master | |
<script src="http://react.zpao.com/builds/master/latest/react.js"></script> | |
--> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/4.7.0/codemirror.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/4.7.0/theme/solarized.min.css"> |
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 archiveWeeks(tasks) { | |
var startOfDay = (date) => new Date(date).setHours(0, 0, 0); | |
return lodash.chain(tasks) | |
.reverse() | |
.groupBy((task) => startOfDay(task.get('created_at')) | |
.map((tasks, date) => ({tasks: tasks, date: new Date(date)})) | |
.groupBy(weekOf) // because I'm lazy | |
.map((days, week) => ({days: days, week: week})) | |
.value(); |
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 resultPromises = Object.keys(queries).map(function(){ | |
var value = queries[key]; | |
return populateTables(value); | |
}); | |
Promise.all(resultPromises).then(runThisAfterAllFinish); |
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
// TODO: Sort by order, using a collectionjs | |
var failedExons = geneExons | |
.filter(function(geneExon){ | |
return geneExon.bins[0].pct > 0 || geneExon.bins[1].pct > 0; | |
}) | |
.map(function(geneExon){ | |
return { | |
exon: geneExon, | |
pct: geneExon.bins[0].pct + geneExon.bins[1].pct |
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 WHForm = React.createClass({ | |
handleBlur: function() { | |
this.props.commitChanges(this.state); | |
}, | |
handleChange: function(ev) { | |
var state = this.state; | |
this.state[ev.target.name] = ev.target.value; | |
this.setState(state); |
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 KEY = Symbol('my key') | |
function makeFoo(){ | |
return { | |
[KEY]: 'my secret key', | |
get key(){ | |
return this[KEY]; | |
} | |
}; | |
} |
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 KEY = Symbol('my key') | |
const fooProto = { | |
get key() { | |
return this[key] | |
} | |
}; | |
function makeFoo() { | |
const foo = Object.create(fooProto); |
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 KEY = Symbol('my key'); | |
class Foo { | |
constructor(){ | |
this[KEY] = 'my secret key'; | |
} | |
get key(){ | |
return this[KEY]; | |
} | |
} |