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
# Require any additional compass plugins here. | |
#set the css file encoding | |
Encoding.default_external = "utf-8" | |
# Set this to the root of your project when deployed: | |
http_path = "/" | |
css_dir = "stylesheets" | |
sass_dir = "sass" | |
images_dir = "images" |
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
server { | |
listen 8080; | |
root /home/www/; | |
index index.html index.htm index.php; | |
server_name localhost; | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(.*)$; |
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
server { | |
listen 8080 default_server; | |
server_name 127.0.0.1; | |
root /home/www/php/; | |
index index.html index.htm index.php; | |
location / { | |
if (!-e $request_filename) { | |
rewrite ^(.*)$ /index.php?s=$1 last; |
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 CG = require('../closure-google'); | |
module.exports = function(app){ | |
app.get('/',function(req,res){ | |
res.render('index', { | |
title: 'Express', | |
output: app.get('data') || '' | |
}); | |
}); | |
app.post('/',function(req,res,next){ | |
var code = req.body.origin_code; |
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 fs = require("fs"), | |
path = require('path'), | |
http = require('http'), | |
url = require('url'), | |
zlib = require('zlib'), | |
mime = require('./mime').types, | |
config = require('./config'); | |
var PORT = 9090; |
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'), | |
url = require('url'), | |
path = require('path'), | |
fs = require('fs'); | |
var PORT = 8080, | |
mimeTypes = { | |
"html": "text/html", | |
"jpeg": "image/jpeg", | |
"jpg": "image/jpeg", |
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
/** | |
* Removes all duplicates from an array (retaining only the first | |
* occurrence of each array element). This function modifies the | |
* array in place and doesn't change the order of the non-duplicate items. | |
* | |
* For objects, duplicates are identified as having the same unique ID as | |
* defined by {@link goog.getUid}. | |
* | |
* Runtime: N, | |
* Worstcase space: 2N (no dupes) |
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
//_.bind方法是把func绑定到obj上 | |
var ctor = function(){}; | |
_.bind = function(func, context) { | |
var args, bound; | |
//如果有原生则使用原生的bind方法 | |
if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); | |
if (!_.isFunction(func)) throw new TypeError; | |
//转化为参数数组 | |
args = slice.call(arguments, 2); |
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 each = _.each = _.forEach = function(obj, iterator, context) { | |
if (obj == null) return; | |
if (nativeForEach && obj.forEach === nativeForEach) { | |
//如果是数组,使用数组原生的forEach | |
obj.forEach(iterator, context); | |
} else if (obj.length === +obj.length) { | |
//如果是数组,且没有原生方法 | |
for (var i = 0, l = obj.length; i < l; i++) { | |
if (iterator.call(context, obj[i], i, obj) === breaker) return; | |
} |
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> | |
<meta charset="gbk"> | |
<title>inline-block 空隙测试</title> | |
<style type="text/css"> | |
* { | |
margin: 0; | |
padding: 0; |