- 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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// init VPN manager | |
self.vpnManager = [NEVPNManager sharedManager]; | |
// load config from perference | |
[_vpnManager loadFromPreferencesWithCompletionHandler:^(NSError *error) { |
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'); | |
var path = require('path'); | |
var http = require('http'); | |
var mkdirSync = function (url,mode,cb){ | |
var arr = url.split("/"); | |
mode = mode || 0755; | |
cb = cb || function(){}; | |
if(arr[0]==="."){//处理 ./aaa | |
arr.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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta content="yes" name="apple-mobile-web-app-capable"> | |
<title>iOS Web App</title> | |
<!-- iPhone --> |
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
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
#!/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
//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
/*! | |
* 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
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"; |
NewerOlder