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
const express = require('express') | |
const path = require('path') | |
const port = process.env.PORT || 8080 | |
const app = express() | |
// serve static assets normally | |
app.use(express.static(__dirname + '/public')) | |
// handle every other route with index.html, which will contain | |
// a script tag to your application's JavaScript file(s). |
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
// FIXME:因为在ComponentsLet中引入了所需的组件,所以不会再单独打包出独立的组件.若工程进一步增加,有必要整理代码 | |
const root_Welcome = { | |
path: '/Welcome', | |
getComponent(nextState, cb) { | |
require.ensure([], (require) => { | |
cb(null, require('App/Components/Core/Welcome/WelcomeCpt').default) | |
}, 'Welcome') | |
} | |
}; |
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 fetch from 'isomorphic-fetch'; | |
// usage : const { status, data, error } = yield fetcher('/api/url'); | |
export default function fetcher(url, options = {}) { | |
return new Promise((resolve) => { | |
fetch(url, Object.assign({}, { | |
credentials: 'same-origin', | |
headers: { | |
Accept: 'application/json', | |
'Content-Type': 'application/json', |
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 fetch from 'isomorphic-fetch'; | |
export const REQUEST_POSTS = 'posts/REQUEST'; | |
export const RECEIVE_POSTS = 'posts/RECEIVE'; | |
export const ERROR_POSTS = 'posts/ERROR'; | |
export const ADD_FILTER = 'posts/ADD_FILTER'; | |
export const REMOVE_FILTER = 'posts/REMOVE_FILTER'; | |
// this action is a generic get all posts |
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
( | |
(name,msg) => console.log(name,msg) | |
)("dragon","hello,bird"); | |
( | |
name => console.log(name) | |
)("dragon"); | |
let cat = { | |
name:"tom", |
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
#!/bin/sh | |
echo $ONCEWORK_CLIPBOARD |
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 remote add origin https://github.com/once-work/oncework.git |
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 branch |
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
select t.* from %c% t %c%; |
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 checkout %c% |
OlderNewer