gitflow | git |
---|---|
git flow init |
git init |
x | git commit --allow-empty -m "Initial commit" |
x | git checkout -b develop master |
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
var EmbeddedGist = React.createClass({ | |
propTypes: { | |
gist: React.PropTypes.string.isRequired, // e.g. "username/id" | |
file: React.PropTypes.string // to embed a single specific file from the gist | |
}, | |
statics: { | |
// Each time we request a Gist, we'll need to generate a new | |
// global function name to serve as the JSONP callback. | |
gistCallbackId: 0, |
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
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
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) |
- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
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
#!/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//./ }) |
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
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
╔════════════════╦═══════════════════╗ | |
║ smart componen ║ dumb component ║ | |
╠════════════════╬═══════════════════╣ | |
║ statefull ║ Stateless ║ | |
╠════════════════╬═══════════════════╣ | |
║ container ║ functional ║ | |
╚════════════════╩═══════════════════╝ |
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' | |
class Statefull extends React.Component { | |
constructor(props){ | |
super(props) | |
this.state={ | |
name: '' | |
} | |
} | |
handleChange = (e) => { |
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' | |
const Name = (props) => { | |
return( | |
<div> | |
dumb Component | |
<div> | |
name: {props.name} | |
</div> | |
<input name="name" value={props.name} onChange={props.handleChange}/> |