Skip to content

Instantly share code, notes, and snippets.

Reduce boilerplate in Redux

  • Create actions similar to Flummox.
  • Generate action ids.
  • Supports actions with decorators, promises, and therefore ES7 async.
@box-turtle
box-turtle / README.md
Created October 4, 2015 15:42 — forked from Dr-Nikson/README.md
Auth example (react + redux + react-router)
@box-turtle
box-turtle / modules.js
Created November 9, 2015 11:27 — forked from zackify/.eslintrc
Upgrade to Babel 6
"devDependencies": {
"babel-plugin-syntax-class-properties": "^6.0.14",
"babel-preset-react": "^6.1.2",
"eslint": "^1.9.0",
"eslint-loader": "^1.1.1",
"babel-core": "^6.1.2",
"babel-loader": "^6.0.1",
"babel-preset-es2015": "^6.1.2",
},
@box-turtle
box-turtle / .babelrc
Created November 9, 2015 23:17 — forked from insin/.babelrc
React component testing skeleton
{
"stage": 2,
"loose": "all"
}
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')
@box-turtle
box-turtle / NotficationActionTypes.js
Created November 14, 2015 16:56 — forked from jerairrest/NotficationActionTypes.js
React-toastr Redux Implementation
export const RECEIVE_MESSAGE = 'RECEIVE_MESSAGE';
import {Dropdown} from 'react-bootstrap';
import {SelectList} from 'react-widgets';
const selectData = ['Red', 'Blue', 'Green'];
export default class extends Component {
constructor(props) {
super(props);
this.state = {
@box-turtle
box-turtle / FormExample.js
Created October 5, 2016 17:04 — forked from jquense/FormExample.js
React Form Example / Live version: http://react-form-example.surge.sh/
import React from 'react'
import Form from 'react-formal'
import {
Alert,
Button,
Col, ControlLabel,
Form as BsForm, FormControl, FormGroup as BsFormGroup,
HelpBlock,
} from 'react-bootstrap'
@box-turtle
box-turtle / index.html
Created September 15, 2018 14:42 — forked from kentcdodds/index.html
The one true react boilerplate
<body>
<div id="⚛️"></div>
<script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<script type="text/babel">
ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️'))
</script>
</body>
@box-turtle
box-turtle / basic_sorting_algorithms.js
Created September 23, 2018 14:35
basic sorting algorithm reference
let arr = [2, 7, 1, 3, 9, 5, 10, 4, 6, 8];
/*
Bubble Sort
Loop through the array comparing each item with the adjacent item.
If the item value is less than the item to the left, swap the two items.
Repeat until you make it through the entire array without swapping any items.
O(n^2) time complexity worst case