Skip to content

Instantly share code, notes, and snippets.

@natew
natew / main.jsx
Last active August 29, 2015 14:18
/* WEBPACK VAR INJECTION */(function(module) {/* REACT HOT LOADER */ if (true) { (function () { var ReactHotAPI = __webpack_require__(233), RootInstanceProvider = __webpack_require__(230), ReactMount = __webpack_require__(7), React = __webpack_require__(2); module.makeHot = module.hot.data ? module.hot.data.makeHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(ReactMount); }, React); })(); } (function () {
'use strict';
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; };
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (descriptor.value) descriptor.writable = true; Object.defineProperty(target,
@natew
natew / gist:0072ca690f379d175f9f
Last active August 29, 2015 14:18
coffeescript 2.0
import React, Reapp, View, NestedViewList, List from 'reapp'
import RefreshButton, RotatingLoadingIcon, ArticleItem
Article
@state = { refreshing: false }
mount
:articlesHotLoad
refresh
@natew
natew / gist:3e9345f8419e3d4a4af8
Last active August 29, 2015 14:18
Quotes from #reactnative
[14:30] < Glenjamin> my main discovery was that native forms are nothing like web forms
[11:48] < kureev> hazberg: they definitely need to create just a simple toolbar component
[11:49] < kureev> because either you have no control over it, or you need to do everything by yourself
Stylesheet.create({
respond: {
'max-width > 200px': {
}
}
})
@natew
natew / slideablelist.jsx
Last active August 29, 2015 14:15
Slideable List with Reapp
import React from 'react';
import DottedViewList from 'reapp-ui/views/DottedViewList';
import View from 'reapp-ui/views/View';
import { Container, Block } from 'reapp-ui/components/Grid';
import List from 'reapp-ui/components/List';
import Input from 'reapp-ui/components/Input';
import Button from 'reapp-ui/components/Button';
export default React.createClass({
getInitialState() {
"data:application/javascript;base64,InVzZSBzdHJpY3QiOwoKLy8gTG9hZCBtb2R1bGVzCgp2YXIgVXRpbHMgPSByZXF1aXJlKCIuL3V0aWxzIik7CgoKLy8gRGVjbGFyZSBpbnRlcm5hbHMKCnZhciBpbnRlcm5hbHMgPSB7CiAgICBkZWxpbWl0ZXI6ICImIiwKICAgIGluZGljZXM6IHRydWUKfTsKCgppbnRlcm5hbHMuc3RyaW5naWZ5ID0gZnVuY3Rpb24gKG9iaiwgcHJlZml4LCBvcHRpb25zKSB7CiAgICBpZiAoVXRpbHMuaXNCdWZmZXIob2JqKSkgewogICAgICAgIG9iaiA9IG9iai50b1N0cmluZygpOwogICAgfSBlbHNlIGlmIChvYmogaW5zdGFuY2VvZiBEYXRlKSB7CiAgICAgICAgb2JqID0gb2JqLnRvSVNPU3RyaW5nKCk7CiAgICB9IGVsc2UgaWYgKG9iaiA9PT0gbnVsbCkgewogICAgICAgIG9iaiA9ICIiOwogICAgfQoKICAgIGlmICh0eXBlb2Ygb2JqID09PSAic3RyaW5nIiB8fCB0eXBlb2Ygb2JqID09PSAibnVtYmVyIiB8fCB0eXBlb2Ygb2JqID09PSAiYm9vbGVhbiIpIHsKICAgICAgICByZXR1cm4gW2VuY29kZVVSSUNvbXBvbmVudChwcmVmaXgpICsgIj0iICsgZW5jb2RlVVJJQ29tcG9uZW50KG9iaildOwogICAgfQoKICAgIHZhciB2YWx1ZXMgPSBbXTsKCiAgICBpZiAodHlwZW9mIG9iaiA9PT0gInVuZGVmaW5lZCIpIHsKICAgICAgICByZXR1cm4gdmFsdWVzOwogICAgfQoKICAgIHZhciBvYmpLZXlzID0gT2JqZWN0LmtleXMob2JqKTsKICAgIGZvciAodmFyIGkgPSAwLCBpbCA9IG9iaktleXMubGVuZ3RoOyBpIDwgaWw7
@natew
natew / webpack.config.js
Created February 6, 2015 04:38
webpack
Webpack config:
{ entry:
{ main:
[ 'webpack-dev-server/client?http://localhost:3011',
'webpack/hot/only-dev-server',
'./app/app.js' ] },
output:
{ path: '/Users/nw/projects/reapp/reapp-kitchen/build/public',
filename: '[name].js',
chunkFilename: '[id].js',
This file has been truncated, but you can view the full file.
{"errors":[],"warnings":["./app/routes.js\nCritical dependencies:\n25:16-23 require function is used in a way, in which dependencies cannot be statically extracted\n @ ./app/routes.js 25:16-23"],"version":"1.5.3","hash":"34ba053960e0a21e2f99","time":9355,"assetsByChunkName":{"main":"main.js"},"assets":[{"name":"main.js","size":1541590,"chunks":[0],"chunkNames":["main"],"emitted":true}],"chunks":[{"id":0,"rendered":true,"initial":true,"entry":true,"extraAsync":false,"size":1279840,"names":["main"],"files":["main.js"],"hash":"f2983abf0d200cca0f57","parents":[],"modules":[{"id":0,"identifier":"multi main","name":"multi main","size":52,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"assets":[],"failed":false,"errors":0,"warnings":0,"reasons":[]},{"id":1,"identifier":"/Users/nw/projects/reapp/reapp-pack/node_modules/webpack-dev-server/client/index.js?http://localhost:3011","name":"../reapp/reapp-pack/~/webpack-dev-server/client?http://localhost:3011","size":1674,"cacheable":true,"bu
{ entry:
{ main:
[ 'webpack-dev-server/client?http://localhost:3011',
'webpack/hot/only-dev-server',
'./app/app.js' ] },
output:
{ path: '/Users/nw/projects/reapp/reapp-hn/build/public',
filename: '[name].js',
chunkFilename: '[id].js',
publicPath: '/',
@natew
natew / out
Last active August 29, 2015 14:13
webpack.config.js
{ entry: { main: './app/app.js' },
output:
{ path: '/Users/nw/projects/reapp/reapp-hn/build/public',
filename: '[name].js',
chunkFilename: '[id].js',
publicPath: '/',
sourceMapFilename: 'debugging/[file].map',
libraryTarget: undefined,
pathinfo: true },
target: 'web',