Skip to content

Instantly share code, notes, and snippets.

HuangYao backsapce

Block or report user

Report or block backsapce

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
backsapce / uploadFile.js
Created Sep 26, 2017
formidable upload file for express
View uploadFile.js'/uploadFile',function (req,res) {
// create an incoming form object
var form = new formidable.IncomingForm();
// specify that we want to allow the user to upload single files in a single request
form.multiples = false;
//keep the file upload extensions
form.keepExtensions = true;
// 500M limit
form.maxFieldsSize = 500 * 1024 * 1024;
// store all uploads in the /uploads directory
backsapce / .vimrc
Last active Jul 30, 2017
my personal vim config
View .vimrc
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" complection support js tern used by omni completion
// Copyright © 2015 Daniel Porrey
// This file is part of the DHT11 Temperature Sensor project
// on (based on the code posted by Posted by Rahul Kar
// found at
// Dht11_Speed.c is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
View country_codes.json
"1": "united states",
"7": "kazakhstan",
"20": "egypt",
"27": "south africa",
"30": "greece",
"31": "netherlands",
"32": "belgium",
"33": "france",
"34": "spain",
backsapce / achiver-download.js
Last active Aug 29, 2015
achiver zip compress download comptible with ie 6 filefox chrome.NOTE: Only a example and can not run derectly
View achiver-download.js
var fs = Npm.require('fs');
var path = Npm.require('path');
var archiver = Npm.require('archiver');
var req = this.request;
var res = this.response;
//create archiver class
var zip_name; //must with .zip ext. for example
var archive = archiver('zip', {
backsapce /
Last active Aug 29, 2015
funning meteor learning in afternoon!!

####1. 限制必须登录后才能上传; 两处代码更改。 第一处在客户端部分,改变resumable的fileAdded触发事件代码

#insert fallowing code under line 84
if !Meteor.userId()
	alert('please login first!');
	return false;
View ascii_logo
backsapce / css
Last active Aug 29, 2015
View css
margin:0 auto;
backsapce / hnust_jiaowu.js
Last active Aug 29, 2015
View hnust_jiaowu.js
// ==UserScript==
// @name hnust_jiaowu
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description 解决湖南科技大学教务网不能兼容Chrome和Firefox浏览器的问题
// @match
// @copyright 2012+, You
// @grant GM_setValue
// @grant GM_getValue
backsapce / css
Last active Aug 29, 2015
inifite scroll
View css
body {
padding: 0px;
margin: 0px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
a {
color: #00B7FF;
You can’t perform that action at this time.