This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vendor | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import {Router, browserHistory} from 'react-router'; | |
import {Provider} from 'react-redux'; | |
import routes from './routes'; | |
import configureStore from './store/configureStore'; | |
import {loadState, saveReduxStore} from './store/localStorage'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component, PropTypes} from 'react'; | |
import connectContent from 'components/ConnectContent'; | |
// import container components | |
// import ExampleApp from 'components/ExampleApp'; | |
// map imports to strings so they can be selected with data | |
const sectionTypes = { | |
// example: ExampleApp, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Map} from 'immutable'; | |
/** | |
* Accrue redux middleware will only return actions that have accured enough interest | |
* | |
* change in accrued interest is calculated by interest += (next - prev) | |
* Math.abs(interest) >= resistance for action to recieve accrued flag | |
* | |
* To opt into this functionality add {meta: {resistance: <value>, accrue: <field>}} to the dispatched action. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get the offset of an element relative to another element (body by default) | |
* @param {element} elem - DOM element to use | |
* @param {element} relativeElem - DOM element to compare against | |
* @returns {object} - {top, left} | |
*/ | |
export default function offset(elem, relativeElem = document.body) { | |
const | |
elemRect = elem.getBoundingClientRect(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component, PropTypes} from 'react'; | |
const DEFAULT_STROKE_WIDTH = 0.15; | |
const DEFAULT_STROKE_COLOR = '#e1e1e1'; | |
/** | |
* SVGPath is an svg <path> element with utitlities | |
* | |
* @param {object[]} points - Array of Point objects - {x, y} - to plot this path | |
* @param {string} color - stroke color of path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
circle { | |
.nthloop(8); | |
} | |
.nthloop(@counter) when (@counter > 0) { | |
.nthloop((@counter - 1)); | |
&:nth-of-type(@{counter}) { | |
animation-delay: (@counter * .1s); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Double Linked list | |
*/ | |
export default class LinkedList { | |
constructor() { | |
this.head = null; | |
this.tail = null; | |
this.size = 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this file should actually be in reducers/index.js | |
import {combineReducers} from 'redux'; | |
const rootReducer = combineReducers( | |
allReducers(require.context('.', false, /^\.\/(?!index)\w+$/)) | |
); | |
export default rootReducer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Turns generators into async demons | |
* | |
* Within the generator function, any "yield" operator becomes enhanced with async powers | |
* allowing them to yield promises. | |
* | |
* @example | |
* spawn(function *() { | |
* const data = yield fetch('/foo.json'); // will be resolved and assigned to "data" var | |
* console.log(data); // write like its sync but its acually async ;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component, PropTypes} from 'react'; | |
import {connect} from 'react-redux'; | |
import {bindActionCreators} from 'redux'; | |
import * as resizeActions from 'actions/windowMonitorActions'; | |
import * as styleOptions from 'constants/styleOptions'; | |
/** | |
* High order component for connecting components to resize events |