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 m = require('mithril'); | |
var icons = require('client/utils/icons'); | |
function checkbox(label, options) { | |
options = options || {}; | |
var onclick = function(event) { | |
event.stopImmediatePropagation(); | |
options.onchange && options.onchange({ |
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 styler = require('./styler'); | |
function mainView() { | |
return [ | |
styler.view(), | |
//... | |
]; | |
} |
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 m = require('mithril'); | |
var t = require('client/utils/translate'); | |
var vagueTime = require('vague-time'); | |
var l16n = require('client/utils/l16n'); | |
function assignValue(obj, objAttr) { | |
return function (event) { |
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 elasticsearch = require('elasticsearch'); | |
var Promise = require('bluebird'); | |
var log = console.log.bind(console); | |
var client = new elasticsearch.Client({ | |
host: 'localhost:9200', | |
log: 'trace' |
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'; | |
function noop(){} | |
var contentView = noop; | |
var elPos = { left: 0, bottom: 0}; | |
var tooltip = { | |
show: function(content, options) { | |
return function(event) { |
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 m = require('mithril'); | |
var icons = require('client/utils/icons'); | |
var remove = require('lodash/array/remove'); | |
var transform = require('lodash/object/transform'); | |
var last = require('lodash/array/last'); | |
var code = require('yields-keycode'); | |
function sameAs(filterA) { |
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 bus = require('./bus'); | |
var throttle = require('lodash/function/throttle'); | |
function getOffsetX(event) { | |
return event.offsetX || event.layerX; | |
} | |
function getOffsetY(event) { |
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 directions = [[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]]; | |
function evolve(currentCells) { | |
const equalTo = (a) => (b) => a[0] === b[0] && a[1] === b[1]; | |
const isCurrentlyAlive = (cell) => currentCells.some(equalTo(cell)); | |
const add = (a) => (b) => [a[0] + b[0], a[1] + b[1]] | |
const neighboursOf = (cell) => directions.map(add(cell)); | |
const notIn = (list) => (item) => !list.some(equalTo(item)); | |
const countNeighbours = (cell) => neighboursOf(cell).filter(isCurrentlyAlive).length; | |
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 Octokat = require('octokat'); | |
var extend = require('lodash/object/assign'); | |
var defaults = { | |
branchName: 'master', | |
token: '', | |
username: '', | |
reponame: '' |
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"; | |
/* | |
Chainable formatters | |
Usage: | |
function trim(value) { | |
return value.trim(); | |
} |