Region Code | Region Name | Availability Zones |
---|---|---|
us-east-1* | N. Virginia | us-east-1a us-east-1b us-east-1c us-east-1d us-east-1e |
us-east-2 | Ohio | us-east-2a us-east-2b us-east-2c |
us-west-1* | N. California | us-west-1a us-west-1b us-west-1c |
us-west-2 | Oregon | us-west-2a us-west-2b us-west-2c |
eu-west-1 | Ireland | eu-west-1a eu-west-1b eu-west-1c |
eu-central-1 | Frankfurt | eu-central-1a eu-central-1b |
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
package main | |
import ( | |
"context" | |
"encoding/hex" | |
"fmt" | |
"strings" | |
"github.com/ethereum/go-ethereum" | |
"github.com/ethereum/go-ethereum/accounts/abi" |
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 FindProxyForURL = function(init, profiles) { | |
return function(url, host) { | |
"use strict"; | |
var result = init, scheme = url.substr(0, url.indexOf(":")); | |
do { | |
result = profiles[result]; | |
if (typeof result === "function") result = result(url, host, scheme); | |
} while (typeof result !== "string" || result.charCodeAt(0) === 43); | |
return result; | |
}; |
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
In [1]: %paste | |
import sys | |
import logging | |
PROGRESS = 1000 | |
class MyLogger(logging.Logger): | |
PROGRESS = PROGRESS | |
LOG_FORMATTER = '%(asctime)s - %(levelname)-10s - %(funcName)s - %(message)s' |
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> | |
<meta charset="utf-8"> | |
<style> | |
svg { | |
font: 10px sans-serif; | |
} | |
</style> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> |
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
{ | |
"meta": { | |
"limit": 3, | |
"next": "/myapp/comment/comment/?note=1&offset=3&limit=3&format=json", | |
"offset": 0, | |
"previous": null, | |
"total_count": 4 | |
}, | |
"objects": [ | |
{ |
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
# url http://stackoverflow.com/questions/13447226/count-how-many-times-a-part-of-a-key-appears-in-a-dictionary-python | |
from collections import Counter | |
from itertools import chain | |
a = { (1,2):3, (1,3):5, (2,1):6 } | |
# first | |
# nested iter, order is important | |
Counter(j for k in a for j in k) |
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 python | |
# -*- coding: UTF-8 -*- | |
import json | |
point1 = 39.988948, 116.417802 | |
point2 = 39.955797, 116.483548 | |
results = [] | |
with open('points.json') as f: |
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
def slugify(value): | |
""" | |
Normalizes string, converts to lowercase, removes non-alpha characters, | |
and converts spaces to hyphens. | |
Took from django sources. | |
""" | |
value = Markup(value).striptags() | |
if type(value) == unicode: | |
import unicodedata |
NewerOlder