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
var http = require("http"); | |
var fs = require("fs"); | |
var url = require("url"); | |
var path = require("path"); | |
var transferFile = function (request, response) { | |
var uri = url.parse(request.url).pathname; | |
var filepath = path.join(process.cwd(), uri); | |
path.exists(filepath, function (exists) { |
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 | |
# YUI compressor shell 简单脚本 | |
# params: | |
# -f 需要压缩的文件名 | |
# -o 输出文件名 | |
# -c 压缩编码 | |
# 使用说明: | |
# 在~/.profile 中为本脚本的执行添加一个别名比如: | |
# alias yui="/users/neekey/yuicompressor.sh" | |
# 然后进入需要压缩文件的目录: |
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
var DB = require( '../../database/' ); | |
var mongoose = require( 'mongoose' ); | |
var Item = mongoose.model( 'item' ); | |
describe( 'mongooseTest', function(){ | |
it( 'localtion test', function(){ | |
var itemsLen = 0; |
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(){ | |
var Mods = App.mods; | |
var DefaultAction = 'index'; | |
Mods.route = (function (){ | |
var Route = { | |
/** | |
* 设置hash |
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
body{ background-image: url(http://s.acfun.tv/h/Images/Upload/225d3b6b-de84-4d6c-bf67-477d5b9a28e2.jpg)!important; background-repeat: no-repeat!important; background-position: 0px 0px!important; background-attachment: fixed!important; background-size: cover!important; } | |
#stage{ background-color: rgba(0, 0, 0, 0)!important; } | |
#header{ height: 128px!important; background: url() 0px 0px repeat-x!important; } | |
#area-topic{ background-color: rgba(255, 255, 255, 0.5)!important; border-radius: 15px 15px 0px 0px!important; } | |
#list-topic-third{ width: 280px!important; height: 200px!important; margin-left: 20px!important; border-radius: 4px!important; overflow: hidden!important; background-color: rgba(0, 0, 0, 0)!important; } | |
#header{ border-bottom: 0px solid #ccc!important; } | |
#mainer{ border-top: 0px solid #f9f9f9!important; } | |
#ad-index{ display: none!important; } | |
.tabbable{ background-color: rgba(0, 0, 0, 0)!important; } | |
#area-link{ opacity: 0.9!important; } |
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
/** | |
* 商品种类 | |
*/ | |
var Location = new schema({ | |
// 地点位置 | |
name: { type: String, required: true }, | |
// 位置GPS坐标 | |
location: { type: Array, index: "2d" } | |
}); |
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
var getOSInfo = function() { | |
var ua = navigator.userAgent; | |
// Ref: http://msdn.microsoft.com/en-us/library/ms537503%28VS.85%29.aspx | |
var token = [ | |
// 顺序无关,根据占用率排列 | |
["Windows NT 5.1", "WinXP"], | |
["Windows NT 6.0", "WinVista"], | |
["Windows NT 6.1", "Win7"], | |
["Windows NT 5.2", "Win2003"], | |
["Windows NT 5.0", "Win2000"], |
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
var getBrowserInfo = function() { | |
var ua = navigator.userAgent; | |
// Ref: http://www.useragentstring.com/pages/useragentstring.php | |
var token = [ // 顺序有关 | |
"Opera", // 某些版本会伪装成 MSIE, Firefox | |
"Chrome", // 某些版本会伪装成 Safari | |
"Safari", // 某些版本会伪装成 Firefox | |
"MSIE 6", | |
"MSIE 7", | |
"MSIE 8", |
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
/** | |
* 获取屏幕分辨率 | |
*/ | |
var getScreenInfo = function() { | |
var screen = window.screen; | |
return screen ? screen.width + 'x' + screen.height : ''; | |
}; |
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
Object.keys = (function () { | |
var hasOwnProperty = Object.prototype.hasOwnProperty, | |
hasDontEnumBug = !({toString:null}).propertyIsEnumerable('toString'), | |
dontEnums = [ | |
'toString', | |
'toLocaleString', | |
'valueOf', | |
'hasOwnProperty', | |
'isPrototypeOf', | |
'propertyIsEnumerable', |
OlderNewer