This file contains hidden or 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 { Div } from 'glamorous' | |
const filterPosts = (posts, term) => posts.filter(item => item.includes(term)) | |
function List({ items }) { | |
return <ul>{items.map((p, i) => <li key={i}>{p}</li>)}</ul> | |
} | |
class Index extends React.Component { |
This file contains hidden or 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
class MatchWhenAuthorized extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
authInProgress: true, | |
isAuthenticated: false, | |
} | |
} | |
componentWillMount = () { |
This file contains hidden or 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 React = require('react') | |
const Landing = require('./Landing') | |
const Search = require('./Search') | |
const Layout = require('./Layout') | |
const Details = require('./Details') | |
const ReactRouter = require('react-router') | |
const data = require('../public/data') | |
const { Router, Route, hashHistory, IndexRoute } = ReactRouter | |
const Store = require('./Store') | |
const { store } = Store |
This file contains hidden or 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
// graph nodes | |
var a = {label:"a"}, b = {label:"b"}, c = {label:"c"}, | |
d = {label:"d"}, e = {label:"e"}, f = {label:"f"}, | |
g = {label:"g"}, h = {label:"h"}, i = {label:"i"}; | |
// setup dependency hierarchy (directed graph node edges) | |
a.children = [b,c,d,e]; | |
c.children = [e,f]; | |
d.children = [e,c]; | |
h.children = [a,i,g]; |
This file contains hidden or 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 combine = (...arrays) | |
=> [].concat(...arrays); | |
const compact = arr | |
=> arr.filter(el => el); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) | |
)(); |
This file contains hidden or 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
#!/usr/bin/env node | |
// This plugin replaces text in a file with the app version from config.xml. | |
var wwwFileToReplace = "js/build.js"; | |
var fs = require('fs'); | |
var path = require('path'); | |
var rootdir = process.argv[2]; |
This file contains hidden or 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
#platform agnostic | |
platforms/*/assets/www | |
# Android | |
platforms/android/assets/www | |
platforms/android/bin/ | |
platforms/android/gen/ | |
platforms/android/res/xml/config.xml | |
platforms/android/ant-build | |
platforms/android/ant-gen |
This file contains hidden or 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 randomString(length) { | |
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split(''); | |
if (! length) { | |
length = Math.floor(Math.random() * chars.length); | |
} | |
var str = ''; | |
for (var i = 0; i < length; i++) { | |
str += chars[Math.floor(Math.random() * chars.length)]; |