Skip to content

Instantly share code, notes, and snippets.

@code-mvp
code-mvp / _README.md
Created May 20, 2017 05:52 — forked from petehouston/_README.md
An alternative routing example for React.js

This is a small example to build a simple routing solution for React.js instead of using the popular React Router.

It utilizes great libraries e.g. history and universal-router which are React-independent.

The example includes:

  • A singleton history object for URL navigation
  • A Router component to route different child components
  • A Link component that acts as those in React Router or in React Static Boilerplate
  • An example component App to demostrate their usages
@code-mvp
code-mvp / web-servers.md
Created May 12, 2017 05:09 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@code-mvp
code-mvp / react2ng1.js
Created May 7, 2017 17:07 — forked from aantipov/react2ng1.js
A simple way to convert React components into AngularJS components
import React from "react";
import ReactDOM from "react-dom";
import { fromPairs, map, pick } from "ramda";
/**
* Wraps a React component into Angular component. Returns a new Angular component.
*
* Usage: angular.module('some.module').component('newAngularComponent', react2angular(MyReactComponent))
* (the usage is the same as in similar lib https://github.com/coatue-oss/react2angular)
*/