NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| """ | |
| Usage: | |
| fab deploy:appname | |
| """ | |
| from fabric.api import env, run, cd, local, put | |
| env.hosts = ['myserver.com'] | |
| env.user = 'eric' |
| application: you-app-name-here | |
| version: 1 | |
| runtime: python | |
| api_version: 1 | |
| default_expiration: "30d" | |
| handlers: | |
| - url: /(.*\.(appcache|manifest)) | |
| mime_type: text/cache-manifest |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
| import boto | |
| s3 = boto.connect_s3() | |
| bucket = s3.lookup('mybucket') | |
| key = bucket.lookup('mykey') | |
| # Copy the key onto itself, preserving the ACL but changing the content-type | |
| key.copy(key.bucket, key.name, preserve_acl=True, metadata={'Content-Type': 'text/plain'}) | |
| key = bucket.lookup('mykey') |
| <!-- copy this to YOUR_THEME.tmTheme--> | |
| <dict> | |
| <key>name</key> | |
| <string>diff: deleted</string> | |
| <key>scope</key> | |
| <string>markup.deleted</string> | |
| <key>settings</key> | |
| <dict> | |
| <key>background</key> | |
| <string>#EAE3CA</string> |
| function TodoCrtl($scope) { | |
| $scope.newItem = ''; | |
| $scope.todoList = []; | |
| $scope.addItem = function(){ | |
| if(this.newItem){ | |
| this.todoList.push({label:this.newItem}); | |
| this.newItem = ''; | |
| } | |
| } |
| #-*- coding: utf-8 -*- | |
| import urllib, re, os, argparse | |
| RE_NEXT_URL = ur'<a href=\"(?!javascript\:)([^\"]*?)">下一页<\/a>' | |
| RE_PICTURE = ur'<p\s+(?:align=\"center\")>\s*<img.*?src=\"(.*?)\".*?\/?>' | |
| RE_ARCTITLE = ur'var arctitle=\'(.*?)\';' | |
| def get_html(url): | |
| try: | |
| return urllib.urlopen(url).read().decode('gbk') |
| CONNECT | |
| DELETE | |
| GET | |
| HEAD | |
| OPTIONS | |
| PATCH | |
| POST | |
| PUT | |
| TRACE |
| //已发送邮件的标记内容 | |
| var EMAIL_SENT = "EMAIL_SENT"; | |
| //记录已发送记录的列,一般为原有数据的后面一列,从0开始 | |
| var EMAIL_SENT_COLUMN = 9; | |
| // 发送的邮件主题 | |
| var SUBJECT = "北京GDG之编程语言沙龙参会确认函"; | |
| // email 所在的列,从0开始算 |