- lxml - Pythonic binding for the C libraries libxml2 and libxslt.
- boto - Python interface to Amazon Web Services
- Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
- Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
- PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
- Celery - Task queue to distribute work across threads or machines.
- pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.
- 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
- Compass - Open source CSS Authoring Framework.
- Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
- Font Awesome - The iconic font designed for Bootstrap.
- Zurb Foundation - Framework for writing responsive web sites.
- SASS - CSS extension language which allows variables, mixins and rules nesting.
- Skeleton - Boilerplate for responsive, mobile-friendly development.
This file contains hidden or 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 obj = new Object(); | |
| obj.triggerOnce = function(fn) { //控制让函数只触发一次 | |
| return function() { | |
| try { | |
| fn.apply(this, arguments); | |
| } | |
| catch (e) { | |
| var txt = "There was an error on this page.\n\n"; | |
| txt += "Error message: " + e.message + "\n\n"; |
This file contains hidden or 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
| ~~(1.111) // 1 | |
| ~~(1.555) // 1 |
This file contains hidden or 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
| /* | |
| * 假设write_log()花费1秒,那么read_data()得多等1秒才能返回, | |
| * 然后show_data()才能把数据展示给用户。但是用户根本不关心你的日志, | |
| * 让用户为此多等1秒其实毫无意义,这种场景就可以用setTimeout(callback,0)来调用write_log | |
| * 让read_data()立刻返回并将数据展示给用户。node里可以用nextTick,会更快一些。 | |
| */ | |
| function read_data(){ | |
| read_file(); | |
| write_log(); | |
| //setTimeout(write_log,0); |
This file contains hidden or 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
| # 忽略*.o和*.a文件 | |
| *.[oa] | |
| # 忽略*.b和*.B文件,my.b除外 | |
| *.[bB] | |
| !my.b |
This file contains hidden or 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 len=4; while(len--){ setTimeout(function(){ alert(len); },0); alert(len); } | |
| // output: 3,2,1,0,-1,-1,-1,-1. | |
| var len=4; while(len--){ (function(i){ setTimeout(function(){ alert(i); },0); })(len); alert(len); } | |
| // output: 3,2,1,0,1,2,3,0 |
This file contains hidden or 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
| //fix IE first open | |
| (function (con) { | |
| 'use strict'; | |
| var prop, method; | |
| var empty = {}; | |
| var dummy = function () { }; | |
| var properties = 'memory'.split(','); | |
| var methods = ('assert,count,debug,dir,dirxml,error,exception,group,' + | |
| 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,' + | |
| 'time,timeEnd,trace,warn').split(','); |
This file contains hidden or 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
| <meta http-equiv="REFRESH" content="0;url=http://www.greensock.com/get-started-js/"> |
This file contains hidden or 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'), | |
| rmdirPath = process.argv[2]? process.argv[2]: 'node_modules'; | |
| var rmdirSync = (function(){ | |
| function iterator(url,dirs){ | |
| var stat = fs.statSync(url); | |
| if(stat.isDirectory()){ | |
| dirs.unshift(url); | |
| inner(url,dirs); | |
| }else if(stat.isFile()){ |