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 Icon from 'react-fa' | |
import hoverable from 'lib/hocs/hoverable' | |
import instyled, { flatKeyed } from 'instyled' | |
import cascade from 'cascade' | |
export const EditButton = hoverable( | |
instyled( | |
flatKeyed( | |
cascade({ | |
position: 'absolute', |
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, { Component } from 'react' | |
import instyled, { flatKeyed } from 'instyled' | |
import cascade from 'cascade' | |
const CheckboxContainer = instyled(flatKeyed(cascade({ | |
display: 'flex', | |
width: 'fit-content', | |
padding: 10, | |
borderRadius: 7, | |
background: 'gray', |
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 branchDispatch = (obj, table, defaultFn) => | |
Object.entries(obj) | |
.map(([key, value]) => | |
table[key] != null | |
? [key, table[key](value)] | |
: typeof defaultFn === 'function' | |
? [key, defaultFn(value)] | |
: [key, undefined] | |
) | |
.reduce((results, [key, 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
Running watch.js on node 0.10.17 and OS X 10.8.5 gives the following when editing (in Sublime Text) and saving file in the same directory: | |
change : a.txt | |
rename : .subl319.tmp | |
change : a.txt | |
rename : .subl69d.tmp | |
etc... | |
Doing the same on 0.10.18 gives: |
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 fs = require('fs'); | |
var read = require('read'); | |
var myBook = []; | |
var data = fs.readFileSync(__dirname + '/data.json', { encoding: 'utf8', flag: 'a+' }); | |
if (data) { | |
myBook = JSON.parse(data); | |
} |
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 ifFilesExist (files, cb) { | |
var numberOfFiles = files.length | |
, returnsChecked = 0 | |
, existancesConfirmed = 0; | |
for (var i = 0; i < numberOfFiles; i++) { | |
fs.exists(files[i], next); | |
} | |
function next (e) { |
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
{ | |
"name": "knode.github.io", | |
"version": "0.0.1", | |
"description": "knode.github.io ===============", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"postupdate": "echo \"Updated...\" && exit 0" | |
}, | |
"repository": { |
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' | |
const async = makeGenerator => function () { | |
const generator = makeGenerator.apply(this, arguments); | |
const handle = result => | |
result.done | |
? Promise.resolve(result.value) | |
: Promise.resolve(result.value) | |
.then(res => handle(generator.next(res))) |
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
it("given I'm allergic to nuts and hate mushrooms, it should find a pizza I can eat (imperative)", function () { | |
var i,j,hasMushrooms, productsICanEat = []; | |
for (i = 0; i < products.length; i+=1) { | |
if (products[i].containsNuts === false) { | |
hasMushrooms = false; | |
for (j = 0; j < products[i].ingredients.length; j+=1) { | |
if (products[i].ingredients[j] === "mushrooms") { | |
hasMushrooms = true; |
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
// Copyright (C) 2015 Comcast Cable Communications, LLC | |
// Contact Us: http://customer.xfinity.com/contact-us/ | |
// Intended use of this message is to display critical and time sensitive notifications to customers. | |
/* | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU General Public License | |
as published by the Free Software Foundation; either version 2 | |
of the License, or (at your option) any later version. | |
This program is distributed in the hope that it will be useful, |