Skip to content

Instantly share code, notes, and snippets.

@natew
natew / firsttry.js
Created February 4, 2016 00:58
attempting to corral giant view
function getSource() {
if (source.hasOwnProperty('length')) {
return new Map(source.map((item) => [item, item]))
} else {
return new Map(Object.keys(source).map((key) => [key, source[key]]))
}
}
function getQuery(key) {
return !multiple && value ? getSource().get(key) : ''
@natew
natew / 1stdout
Last active January 20, 2016 06:30
➜ ~ npm install -g flint
npm WARN install:alphanum-sort@1.0.2 ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/flint/node_modules/flint-runner/node_modules/alphanum-sort' -> '/usr/local/lib/node_modules/flint/node_modules/alphanum-sort'
npm WARN install:amdefine@1.0.0 ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/flint/node_modules/flint-runner/node_modules/amdefine' -> '/usr/local/lib/node_modules/flint/node_modules/amdefine'
npm WARN install:ansi-styles@2.1.0 ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/flint/node_modules/flint-runner/node_modules/ansi-styles' -> '/usr/local/lib/node_modules/flint/node_modules/ansi-styles'
npm WARN install:ansi-wrap@0.1.0 ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/flint/node_modules/flint-runner/node_modules/ansi-wrap' -> '/usr/local/lib/node_modules/flint/node_modules/ansi-wrap'
npm WARN install:archy@1.0.0 ENOENT: no such file or directory, rename '/usr/local/lib/node_mo
module.exports = {
loaders:
[
{ test: /\.css$/, loaders: ['style', 'css'] },
{ test: /\.json$/, loader: "json" }
],
// resolveLoader: {
// root: '/Users/nw/flint/packages/runner'
// },
resolve: {
@natew
natew / a.js
Created November 21, 2015 01:28
import / export
import fns from './a'
view One {
var a = fns.aa()
}
view Two {
var b = fns.bb()
}
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
view SayHi {
let size = 10
<h1>hello</h1>
<button onClick={() => size += 20}>up</button>
$h1 = { fontSize: size, color: 'blue' }
}
if (t.isArrayExpression(node.right)) {
let staticProps = []
node.right.elements = node.right.elements.map(el => {
if (!t.isObjectExpression(el)) return el
let { statics, dynamics } = extractStatics(el)
if (statics.length) staticProps.push(statics)
if (dynamics.length) return t.objectExpression(dynamics)
else return null
store Farm {
@animals = ['cow', 'chicken', 'turkey']
}
view Main {
@name = 'Horse'
setAnimal = animal => @name = animal
<h1>Select your favorite animal</h1>
return (
<ListItem.item
key={key || index}
onTap={this.handleTap.bind(this)}
title={article.get('title')}
after={articleRight}
index={index}
noicon
{...props}>
{stats}