Yet another framework syndrome
| Name | Date | URL | Stars |
|---|---|---|---|
| Jake | April 2010 | https://github.com/mde/jake | 866 |
| Brunch | January 2011 | http://brunch.io/ | 3359 |
| """ | |
| python建立pip.ini | |
| 使用国内的 豆瓣 作为安装源 加速安装过程 | |
| """ | |
| import os | |
| ini="""[global] | |
| index-url = https://pypi.doubanio.com/simple/ | |
| [install] |
| $(function () { | |
| "use strict"; | |
| var placeholderColor = "#999999"; | |
| var addTextFieldPlaceholderSupport = function (elem, text) { | |
| var e = $(elem); | |
| if (!e.val()) | |
| e.val(text).data("textColor", e.css("color")).css("color", placeholderColor); | |
| e.focus(function () { | |
| if (e.val() == text) |
| // 16进制色值转换成rgba | |
| function HEX2RGB(HEX, opacity){ | |
| opacity=opacity || "1.0"; | |
| HEX = HEX.replace("#",""); | |
| var r = parseInt(HEX.substring(0,2),16); | |
| var g = parseInt(HEX.substring(2,4),16); | |
| var b = parseInt(HEX.substring(4,6),16); | |
| return "rgba("+r+","+g+","+b+","+opacity+")"; | |
| } |
| url = urlparse('http://v.youku.com/v_show/id_XNzQ4MTcyMDE2.html?f=22598191') | |
| if url.netloc == 'v.youku.com': | |
| try: | |
| video_id = url.path.split('/')[-1].split('.')[0][3:] | |
| except: | |
| pass | |
| else: | |
| video = 'http://player.youku.com/embed/%s' % video_id |
Yet another framework syndrome
| Name | Date | URL | Stars |
|---|---|---|---|
| Jake | April 2010 | https://github.com/mde/jake | 866 |
| Brunch | January 2011 | http://brunch.io/ | 3359 |
| #!/bin/bash | |
| GEOGRAPHY=0 | |
| POSTGIS_SQL=postgis.sql | |
| # For Ubuntu 8.x and 9.x releases. | |
| if [ -d "/usr/share/postgresql-8.3-postgis" ] | |
| then | |
| POSTGIS_SQL_PATH=/usr/share/postgresql-8.3-postgis | |
| POSTGIS_SQL=lwpostgis.sql |
| VBoxManage startvm "breadtrip" --type headless | |
| VBoxManage controlvm "breadtrip" poweroff |
| from __future__ import with_statement | |
| from ilogue.fexpect import expect, expecting, run as erun | |
| from fabric.api import settings, local, put, cd, run | |
| import time | |
| import datetime | |
| import random | |
| import logging | |
| GIT_HOST = 'git@localhost' |
| import codecs | |
| import os | |
| includes = ['*.php', '*.html', '*.htm'] | |
| for root, dirs, files in os.walk('pay.lvye.cn'): | |
| for filename in files: | |
| filename = os.path.join(root, filename) | |
| with open(filename) as f: | |
| content = f.read() |
| import time | |
| from datetime import datetime, date | |
| # 今天 | |
| datetime.datetime.today().date().isoformat() | |
| # 通过日期对象生成时间戳 | |
| int(time.mktime(datetime.now().timetuple())) | |
| # 通过时间戳生成日期对象,timestamp 的时间戳以秒为单位 |