这是我在开发 nodediscuss 的过程中实现的,现在单独拆分出来作为一个库,方便有文件上传需求的同学们。
GitHub: https://github.com/heroicyang/express-fileuploader
- 在上传成功之后自动删除临时文件(原因请参见这里)
- 不负责
multipart
解析,你可以自由选择multipart parser
- 插件式,可插拔
- 可根据自己的需求自定义上传逻辑(Strategy),比如将文件上传至
Dropbox
等
{ | |
"vars": { | |
"@gray-base": "#000", | |
"@gray-darker": "lighten(@gray-base, 13.5%)", | |
"@gray-dark": "lighten(@gray-base, 20%)", | |
"@gray": "lighten(@gray-base, 33.5%)", | |
"@gray-light": "lighten(@gray-base, 46.7%)", | |
"@gray-lighter": "lighten(@gray-base, 93.5%)", | |
"@brand-primary": "darken(#428bca, 6.5%)", | |
"@brand-success": "#5cb85c", |
var gulp = require('gulp'); | |
var source = require('vinyl-source-stream'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
gulp.task('setWatch', function() { | |
global.isWatching = true; | |
}); | |
gulp.task('browserify', function() { |
这是我在开发 nodediscuss 的过程中实现的,现在单独拆分出来作为一个库,方便有文件上传需求的同学们。
GitHub: https://github.com/heroicyang/express-fileuploader
multipart
解析,你可以自由选择 multipart parser
Dropbox
等{"whiteKeywords":[],"blackKeywords":[],"grayKeywords":[],"URLKeywords":[],"sourceKeywords":[],"sourceGrayKeywords":[],"userBlacklist":["1706976420"],"tipBackColor":"#FFD0D0","tipTextColor":"#FF8080","readerModeIndex":false,"readerModeProfile":false,"readerModeWidth":"750","readerModeBackColor":"rgba(100%, 100%, 100%, 0.8)","mergeSidebars":true,"floatSidebar":true,"unwrapText":true,"directBigImg":true,"directFeeds":false,"showAllGroups":true,"showAllMsgNav":true,"noDefaultFwd":true,"noDefaultGroupPub":true,"clearDefTopic":true,"overrideMyBack":false,"overrideOtherBack":false,"backColor":"rgba(100%, 100%, 100%, 0.2)","overrideMySkin":false,"overrideOtherSkin":false,"skinID":"skinvip001","filterOthersOnly":true,"filterPaused":false,"filterSmiley":false,"filterPromotions":true,"filterDeleted":true,"filterFeelings":true,"filterTaobao":false,"filterDupFwd":false,"maxDupFwd":"1","filterFlood":false,"maxFlood":"5","updateNotify":true,"autoSync":true,"floatBtn":true,"useCustomStyles":true,"customStyles":".WB_global_na |
{ | |
"groups": {}, | |
"dials": { | |
"0": { | |
"id": 1, | |
"title": "Twitter", | |
"url": "https://twitter.com/", | |
"thumbnail": "", | |
"ts_created": 1381809640, | |
"visits": 18, |
# 终端中输入下面命令来打开 Chrome | |
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --winhttp-proxy-resolver |
var githubList = [ | |
{ | |
name:'系统基础库', | |
list: [ | |
{name:'Category/Util', | |
list: [ | |
{name:'sstoolkit', owner:'soffes', desc:'一套Category类型的库,附带很多自定义控件 功能不错~'}, | |
{name:'BlocksKit', owner:'pandamonia', desc:'将Block风格带入UIKit和Founcation'}, | |
{name:'cocoa-helpers', owner:'enormego', desc:'一些Cocoa的扩展 2年前的工程'}, |
"jshint_options": | |
{ | |
"bitwise": false, | |
"camelcase": true, | |
"curly": true, | |
"eqeqeq": true, | |
"indent": 2, | |
"plusplus": true, | |
"undef": true, | |
"unused": true, |
Handlebars.registerHelper("debug", function(optionalValue) { | |
console.log("Current Context"); | |
console.log("===================="); | |
console.log(this); | |
if (optionalValue) { | |
console.log("Value"); | |
console.log("===================="); | |
console.log(optionalValue); | |
} | |
}); |
var _ = require('underscore') | |
, iconv = require('iconv-lite'); | |
var codes = [214,247,210,170,190,205,202,199,207,235,202,212,202,212,184,248,212,219,195,199,188,196,208,197,202,177,181,216,214,183,191,201,210,212,208,180,181,195,182,224,188,242,194,212,161,173,161,173]; | |
var str = _.map(codes, function (code) { | |
return String.fromCharCode(code); | |
}).join(''); | |
console.log(iconv.decode(new Buffer(str, 'ascii'), 'gbk')); |