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
/* 标题: 函数声明 | |
* 描述: 创建匿名函数并将该函数赋值于一个变量 | |
*/ | |
// 反模式 | |
function getData() { | |
} | |
// 建议的模式 |
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
app.get('/help', function(req, res){ | |
res.send('some help'); | |
}); | |
app.get('/search/:query/p:page', function(req, res){ | |
var query = req.params.query | |
, page = req.params.page; | |
res.send('search "' + query + '", page ' + (page || 1)); | |
}); |
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
if [[ "$PATH" == *"/usr/local/mips-2012.09/bin"* ]]; then | |
echo codesourcery toolchain path is already in PATH var | |
else | |
export PATH="/usr/local/mips-2012.09/bin:$PATH" | |
echo added codesourcery toolchain path to PATH var | |
fi | |
export AR=mips-linux-gnu-ar | |
export CC='mips-linux-gnu-gcc -EL' | |
export CXX='mips-linux-gnu-g++ -EL' |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>HTML5 Multiple File Upload Sample</title> | |
</head> | |
<body> | |
<form action="http://localhost:8080/api/upload" enctype="multipart/form-data" method="POST"> | |
What is your name? | |
<input name="submitter" size="40" type="text"><br> | |
What files are you uploading? |
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
;(function ( name, definition ){ | |
var theModule = definition(), | |
// this is considered "safe": | |
hasDefine = typeof define === 'function' && define.amd, | |
// hasDefine = typeof define === 'function', | |
hasExports = typeof module !== 'undefined' && module.exports; | |
if ( hasDefine ){ // AMD Module | |
define(theModule); | |
} else if ( hasExports ) { // Node.js Module |