This file contains 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> | |
) |
This file contains 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 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 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 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 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 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
{"version":1,"resource":"file:///Users/danielmai/infuse/crystal-inventory-service/.env.development","entries":[{"id":"QSmg.development","timestamp":1649700882559},{"id":"gPX2.development","timestamp":1649707291121},{"id":"Dbfi.development","timestamp":1649707342462}]} |
This file contains 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
Rails form tag: | |
datetime_local_field_tag | |
add: | |
/* global angular */ if having problem with Linter | |
Unit Testing | |
It is better to write modular codes |
This file contains 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
--------6/18/17--------- | |
JavaScript is asyncronous: it does not wait for a function to finish before starting another one. | |
Ruby runs code from top to bottom (synchronous) | |
JavaScript runs code asynchronously. | |
anonymous function: a function with no name | |
function() { | |
console.log('Hello'); | |
} |
This file contains 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
---------6/12/2017------------ | |
Javascript | |
It can return unexpected results | |
> 5 + "2" => "52" | |
> 5 - "2" => 3 | |
parseInt("342") | |
342.toString() | |
type comparison: 5 === '5' => false (strict) | |
5 == '5' => true (loose) |
NewerOlder