Skip to content

Instantly share code, notes, and snippets.

Avatar

Marc Schipperheyn mschipperheyn

View GitHub Profile
View gist:e0f6892d2080e1612acf250ebcbee80a
import React from 'react';
import { makeStyles } from '@material-ui/styles';
import Grid from '@material-ui/core/Grid';
const HIDDEN = 'hidden';
/**
* Hacky solution to deal with missing grid offset
*/
View server-middleware-reactApplication-ServerHTML.js
/**
* This module is responsible for generating the HTML page response for
* the react application middleware.
*/
/* eslint-disable react/no-danger */
/* eslint-disable react/no-array-index-key */
import React, { Children, PropTypes } from 'react';
import serialize from 'serialize-javascript';
View configFactory.js
import appRootDir from 'app-root-dir';
import AssetsPlugin from 'assets-webpack-plugin';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import nodeExternals from 'webpack-node-externals';
import path from 'path';
import webpack from 'webpack';
import WebpackMd5Hash from 'webpack-md5-hash';
import { happyPackPlugin } from '../utils';
import { ifElse } from '../../shared/utils/logic';
View package.json
import appRootDir from 'app-root-dir';
import AssetsPlugin from 'assets-webpack-plugin';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import nodeExternals from 'webpack-node-externals';
import path from 'path';
import webpack from 'webpack';
import WebpackMd5Hash from 'webpack-md5-hash';
import { happyPackPlugin } from '../utils';
import { ifElse } from '../../shared/utils/logic';
@mschipperheyn
mschipperheyn / Marshaller
Created Apr 4, 2016
A marshalling function for Normalizr
View Marshaller
`
'use strict';
const getEntity = function(id, key, entities){
const ent = entities[key][id];
if(ent === undefined || ent === null){
console.log(`Missing object ${key} ${id}`);
}
View Router.js
import React, { Navigator } from 'react-native';
import RouterRegistry from './RouterRegistry';
import navigateTo from './routerActions';
const BACK = 'BACK';
const FORWARD = 'FORWARD';
class Router extends React.Component {