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
var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')
var JSON_CONTENT_TYPE_CHECK = /application\/json/
/**
* Throws an error if a window.fetch response has a non-2XX status code, using a
* 'message' property from response JSON if present, otherwise using the
* response status and text.
* For successful responses, returns a JSON promise or the response itself based
* on the content-type header.
*/
function handleResponse(response) {
@insin
insin / arjuna.js
Last active August 29, 2015 14:27
Arjuna as a Service - http://babeljs.io/repl/
var trackInfo = `1. Early Bird (0:00)
2. Awaking (2:10)
3. Cloe (10:08)
4. Time to Die (13:29)
5. 2nd Life (16:20)
6. Diving (19:25)
7. Clone (22:02)
8. Feel the Circle (24:08)
9. Aerobics (25:44)
@insin
insin / redirect.js
Last active September 15, 2015 03:41
Programmatic redirect for React Router 1.0
var { formatPattern } = require('react-router/lib/URLUtils');
/**
* Programatic equivalent of what's done with a JSX <Redirect/>, as of 6264a91.
*
* See:
* 1. https://github.com/rackt/react-router/blob/6264a91e6f037c3798553cd04ce9c0118f07c9ff/modules/RouteUtils.js#L63
* 2. https://github.com/rackt/react-router/blob/6264a91e6f037c3798553cd04ce9c0118f07c9ff/modules/Redirect.js#L13%29
* 3. https://github.com/rackt/react-router/blob/6264a91e6f037c3798553cd04ce9c0118f07c9ff/modules/RouteUtils.js#L25
*
@insin
insin / ReduxMicroBoilerplate.js
Last active May 30, 2023 19:54 — forked from gaearon/ReduxMicroBoilerplate.js
Super minimal React + Redux app
import React, { Component } from 'react';
import { createStore, combineReducers, applyMiddleware, bindActionCreators } from 'redux';
import { provide, connect } from 'react-redux';
import thunk from 'redux-thunk';
const AVAILABLE_SUBREDDITS = ['apple', 'pics'];
// ------------
// reducers
// ------------
return (
<div>
<h2>Friends</h2>
<ul>
{this.state.friends.map(friend =>
<Friend
key={ friend.id }
friend={ friend }
isSelected={ this.isSelected( friend ) }
toggleSelection={ this.toggleSelection }
form {
margin-bottom: 15px ;
}
table {
border: 1px solid #666666 ;
}
td, th {
border: 1px solid #666666 ;
form {
margin-bottom: 15px ;
}
table {
border: 1px solid #666666 ;
}
td, th {
border: 1px solid #666666 ;
@insin
insin / IDEAS.md
Last active August 29, 2015 14:24
Sample Gist for IDEAS.md

This is the general section for notes which don't belong to anything below.

Hello from the sample Gist!

A Gist needs to contain a file named "IDEAS.md" for IDEAS.md integration to work.

a section

This is a section with ideas and notes about a specific topic.