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]; | |
} | |
} |
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 { Component } from "react"; | |
export var Enhance = ComposedComponent => class extends Component { | |
static displayName = "Enhanced" | |
constructor() { | |
super(); | |
this.state = { data: null }; | |
} | |
componentDidMount() { |
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 { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
static displayName = "Enhanced" | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); |
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'; | |
import md5 from 'MD5'; | |
class Avatar extends React.Component { | |
static propTypes = { | |
email: React.PropTypes.string, | |
size: React.PropTypes.number | |
} | |
static defaultProps = { |