- http://www.python.org/getit/releases/2.7.3/ 找到MSI installer 下载,建议用2.7的版本
- 安装python后添加环境变量 PATH: ;C:\Python27
- 安装python package包管理工具和常用package
- 下载setuptools, http://pypi.python.org/pypi/setuptools#files 找到对应python版本下载installer安装
- 安装pip工具, http://pypi.python.org/pypi/pip 解压后命令行进入解压目录,运行 python setup.py install 然后添加环境变量 PATH: C:\Python27\Scripts
- 用pip安装各种需要的package,比如 pip install distribute ...
- 安装 Django, pip install django
- 安装 pil, pip install pil ,pil好像下载极其艰难 -_-#
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
/* mkdir -p for node */ | |
var fs = require('fs'), | |
path = require('path'); | |
function mkdirpSync (pathes, mode) { | |
mode = mode || 0777; | |
var dirs = pathes.trim().split('/'); | |
if (dirs[0] == '.') { | |
// ./aaa | |
dirs.shift(); |
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 base64Encode(inputStr) { | |
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
var outputStr = ""; | |
var i = 0; | |
while (i < inputStr.length) | |
{ | |
//all three "& 0xff" added below are there to fix a known bug | |
//with bytes returned by xhr.responseText | |
var byte1 = inputStr.charCodeAt(i++) & 0xff; |
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 canvas = false; | |
var context = false; | |
var isCanvas = (document.createElement("canvas").getContext) ? true : false; | |
createCanvas = function(o) { | |
if (isCanvas) { | |
canvas = document.createElement("canvas"); | |
canvas.style.position = "absolute"; | |
canvas.style.width = nw + "px"; | |
canvas.style.height = nh + "px"; |
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
/*! | |
* jstemplate: a light & fast js tamplate engine | |
* License MIT (c) 岑安 | |
*/ | |
;(function (name, definition) { | |
if (typeof define == 'function') define(definition); | |
else if (typeof module != 'undefined') module.exports = definition(); | |
else this[name] = definition(); | |
})('jstemplate', function () { |
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
//background js | |
console.log('JSON Page Format started!') | |
;(function () { | |
var txt = document.body.innerText.trim(), | |
easyReg = /^{.+}$|^(\w+)\(({.+})\)$/; | |
var gIndentStyle=' '; | |
var arr = txt.match(easyReg), jsonTxt; | |
if (!arr) 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
#!/usr/bin/env node | |
// -*- js -*- | |
/** | |
* @example | |
* spmbat ./ | |
*/ | |
var fs = require('fs'), | |
util = require('util'), | |
path = require('path'), |
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 connect(scope, fnFrom, fnTo) { | |
"use strict" | |
var objFn = fnFrom.split('.');//处理传入的函数名 | |
var deepth = objFn.length; | |
var scope = scope || window; | |
var j = deepth,i=j; | |
var _obj = scope,__obj=_obj ; | |
while (i > 0) {//以window.console.log为例,这里利用迭代最终拿到log | |
_obj = _obj[objFn[deepth - i]]; | |
i -= 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
// tasks | |
// ejs: { | |
// 'script/view.jst.js': 'view/**/*.ejs' | |
// }, | |
grunt.registerMultiTask('ejs', 'Compile EJS templates into JST.', function() { | |
var options = { | |
client: true, | |
open: "<%", |
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="utf-8"> | |
<meta content="yes" name="apple-mobile-web-app-capable"> | |
<title>iOS Web App</title> | |
<!-- iPhone --> |
OlderNewer