Based off of: http://docs.sequelizejs.com/en/1.7.0/articles/express/
Create and initialize your a directory for your Express application.
$ mkdir sequelize-demo
diksutil list | |
# change number wit your usb | |
diskutil eraseDisk MS-DOS "{usbName}" MBR disk{number} | |
# open iso files | |
ls /Volumes | |
# try to use -Rp instead | |
cp -Rp /Volumes/{OsIsoName}/* /Volumes/{usbName}/ |
import * as React from "react"; | |
import { Route, RouteProps } from "react-router"; | |
interface Props { | |
component: React.ComponentType<RouteProps>; | |
} | |
export const HomepageLayout = ({ component: Component, ...rest }: Props) => { | |
return ( | |
<Route {...rest} render={routeProps => <Component {...routeProps} />} /> | |
); |
import React from 'react' | |
const Name = (props) => { | |
return( | |
<div> | |
dumb Component | |
<div> | |
name: {props.name} | |
</div> | |
<input name="name" value={props.name} onChange={props.handleChange}/> |
import React from 'react' | |
class Statefull extends React.Component { | |
constructor(props){ | |
super(props) | |
this.state={ | |
name: '' | |
} | |
} | |
handleChange = (e) => { |
╔════════════════╦═══════════════════╗ | |
║ smart componen ║ dumb component ║ | |
╠════════════════╬═══════════════════╣ | |
║ statefull ║ Stateless ║ | |
╠════════════════╬═══════════════════╣ | |
║ container ║ functional ║ | |
╚════════════════╩═══════════════════╝ |
Based off of: http://docs.sequelizejs.com/en/1.7.0/articles/express/
Create and initialize your a directory for your Express application.
$ mkdir sequelize-demo
#!/bin/bash | |
#get highest tag number | |
VERSION=`git describe --abbrev=0 --tags` | |
# get version from node | |
# PACKAGE_VERSION=$(node -p -e "require('./package.json').version") | |
#replace . with space so can split into an array | |
VERSION_BITS=(${VERSION//./ }) |
var co = require('co'); | |
var proc = require('child_process') | |
function exec(command) { | |
var p = new Promise(function (resolve, reject) { | |
proc.exec(command, function (err, stdout, stderr) { | |
if (err) { | |
console.log(stderr); | |
} else { | |
console.log(stdout) |
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux