uptoken 是由PutPolicy经过编码加密得到的,语义如下
| 字段 | 类型 | 语义 |
|---|---|---|
| scope | string | 指定为bucket:key这样的形式,bucket必须 |
| deadline | int | token失效的unix时间戳(单位:秒),必须 |
| #!/usr/bin/env python | |
| """ Rename MacPython wheels for system python and homebrew """ | |
| from __future__ import print_function | |
| import os | |
| from os.path import expanduser, splitext | |
| import sys | |
| from wheel.install import WheelFile | |
| POP_PLAT_TAG = 'macosx_10_6_intel' |
| global | |
| maxconn 10000 # Total Max Connections. This is dependent on ulimit | |
| nbproc 2 | |
| defaults | |
| mode http | |
| option redispatch | |
| maxconn 2000 | |
| contimeout 5000 | |
| clitimeout 50000 |
| upstream rrbackend { | |
| server 127.0.0.1:8080 weight=3; | |
| server 127.0.0.1:8888; | |
| } | |
| map $cookie_backend $backend { | |
| default rrbackend; | |
| experimental 127.0.0.1:8888; | |
| } |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # zipdb.py | |
| # Use a zipfile store a dict like k-v database. | |
| # Known bug: duplicate key(filenames) allowed | |
| # | |
| # Copyright 2012 mayli <mayli.he@gmail.com> | |
| # |
| document.body.innerHTML = "<canvas id='cvs' width='1200px' height='600px'></canvas>"; | |
| cvs = document.getElementById('cvs'); | |
| ctx = cvs.getContext('2d'); | |
| cvs.onmousedown = function(){ | |
| cvs.onmousemove = function(e){ctx.fillRect(e.offsetX,e.offsetY,2,2);console.log(e.clientX);} | |
| }; | |
| cvs.onmouseup = function(){ cvs.onmousemove =function(e){}}; |
| // oldj:设 A = $("#id a"),B = $("#id .c a"),求 A - B。要求: | |
| // 1、不能用 jQuery 等框架; | |
| // 2、兼容 IE6 在内的各大浏览器; | |
| // 3、尽可能高效; | |
| // 4、尽可能简短。 | |
| function getWanted() { | |
| var root = document.getElementById('id') | |
| var all = root.getElementsByTagName('*') |
| - (void)testTwitter | |
| { | |
| // Step 0: Check that the user has local Twitter accounts | |
| BOOL isTwitterAvailable = [SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]; | |
| NSLog(@"isTwitterAvailable:%d", isTwitterAvailable); | |
| if (isTwitterAvailable) { | |
| // Step 1: Obtain access to the user's Twitter accounts | |
| ACAccountStore *accountStore = [[ACAccountStore alloc] init]; |
| # coding=utf-8 | |
| """ | |
| Slugify for Chinese | |
| 没有优化多音字 | |
| 优化多音字的项目有: | |
| https://github.com/jiedan/chinese_pinyin | |
| """ | |
| import re | |
| import unidecode |
| // | |
| // CLLocation+Sino.h | |
| // | |
| // Created by i0xbean@gmail.com on 13-4-26. | |
| // 火星坐标系转换扩展 | |
| // | |
| // earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换 | |
| // 未包含 mars2earth. 需要这个可参考 http://xcodev.com/131.html | |
| #import <CoreLocation/CoreLocation.h> |