Skip to content

Instantly share code, notes, and snippets.

View insin's full-sized avatar
⚠️
Cannot read property 'status' of undefined

Jonny Buchanan insin

⚠️
Cannot read property 'status' of undefined
View GitHub Profile
@insin
insin / FormExample.js
Last active October 10, 2016 23:12
React Form Example / Live version: http://react-form-example.surge.sh/
import React from 'react'
import {
Alert,
Button,
Col, ControlLabel,
Form, FormControl, FormGroup,
HelpBlock,
} from 'react-bootstrap'
import {APPS, APPS_BY_RELEASE} from './metadata'
@insin
insin / columninput.pegjs
Last active May 30, 2023 19:51
PEG.js grammar for parsing input column ranges. Try it at http://pegjs.org/online
/**
* Accepts column ranges expressed using A-Z column names, or 1-based numbers.
*
* Returns a list of column numbers.
*
* e.g. A,B,D-F outputs [1,2,4,5,6]
*/
{
var baseCharCode = 'A'.charCodeAt(0) - 1 // 1-based
@insin
insin / README.md
Last active July 17, 2016 18:19
nwb Babel options for configuring babel-plugin-transform-runtime and polyfilling

nwb babel options for transform-runtime/polyfilling

nwb is getting a new boolean runtime option which triggers use of babel-plugin-transform-runtime

I think it also needs a polyfill option to control polyfilling, as babel-plugin-transform-runtime is also related to polyfilling (see below)

(polyfill could also be used to automatically include babel-polyfill for apps when configured to do so)

babel-plugin-transform-runtime

Clone and install:

git clone https://gist.github.com/45b7f66e01628601c0cc6b79767b0e4f.git so-38236634
cd so-38236634
npm install

Start a hot reloading development server at http://localhost:3000:

@insin
insin / app.js
Last active May 30, 2023 19:51
React Router Test / nwb/React/surge setup - live version: http://tasty-flavor.surge.sh/ - nwb: https://github.com/insin/nwb
import React from 'react'
import {render} from 'react-dom'
import {browserHistory, IndexRoute, IndexLink, Link, Route, Router} from 'react-router'
let activeStyle = {fontWeight: 'bold'}
let App = ({children}) => <div>
<h1>App</h1>
<ul>
<li><IndexLink activeStyle={activeStyle} to="/">Home</IndexLink></li>
@insin
insin / app.js
Last active June 20, 2016 05:13
React/Webpack setup to tweak Prism fairyfloss theme
import './prism-fairyfloss.css'
import 'prismjs'
import React from 'react'
import {render} from 'react-dom'
let App = React.createClass({
componentDidMount() {
window.Prism.highlightAll()
},
@insin
insin / app.js
Last active May 30, 2023 19:52
Checking size of importing all of React Router
import React from 'react'
import {render} from 'react-dom'
import 'react-router'
let App = React.createClass({
render() {
return <div>
<h1>Hello world!</h1>
</div>
code[class*="language-"],
pre[class*="language-"] {
color: #F8F8F2;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
@insin
insin / LICENSE
Last active May 30, 2023 19:52
hn-api-cache - manages a live cache of stories and their comment threads from the Hacker News Firebase API (https://github.com/HackerNews/API)
Copyright (c) 2016, Jonny Buchanan
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@insin
insin / nwb.config.js
Last active May 30, 2023 19:52
Config file used to get the app from https://www.fullstackreact.com/articles/react-tutorial-cloning-yelp hot loading, testing and building with the in-development version of https://github.com/insin/nwb
var path = require('path')
var isDev = process.env.NODE_ENV === 'development'
var isTest = process.env.NODE_ENV === 'test'
var config = {
type: 'react-app',
babel: {
stage: 0,
loose: 'all'