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
| Create alias to make shortcut to regular-typed commands | |
| Steps: | |
| 1. Go to root directory ( cd ~ ) | |
| 2. Open the bash profile ( subl ~/.bash_profile ) | |
| 3. Create alias for command shortcut (for example, the line /alias gs='git status'/ will add an alias "gs" to the command "git status", so you can use "gs" to achieve the same purpose as "git status" |
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
| git add -p | |
| This is useful! |
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 express from "express" | |
| import { renderToString } from "react-dom/server" | |
| import React from 'react' | |
| import App from '../App.js' | |
| import ContextProvider from '../ContextProvider.js' | |
| const app = express() | |
| //Serve the app with the public bundle.js | |
| app.use(express.static("online/dist/")) |
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 from 'react'; | |
| import { hydrate } from 'react-dom' | |
| import App from './App.js' | |
| import ContextProvider from './ContextProvider.js' | |
| const context = { | |
| insertCss: (...styles) => { | |
| const removeCss = styles.map(x => x._insertCss()); | |
| return () => { | |
| removeCss.forEach(f => f()); |
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 from 'react'; | |
| import PropTypes from 'prop-types' | |
| import App from './App' | |
| class ContextProvider extends React.Component { | |
| static childContextTypes = { | |
| insertCss: PropTypes.func, | |
| } | |
| getChildContext() { |
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 from 'react' | |
| import s from './styles/footer.css' | |
| import withStyles from 'isomorphic-style-loader/lib/withStyles' | |
| const Footer = (props) => { | |
| return ( | |
| <div className='footer'> | |
| <p>Copyright @ DANIEL MAI - 2018 All Rights Reserved. </p> | |
| </div> | |
| ) |
OlderNewer