I hereby claim:
- I am shazow on github.
- I am shazow (https://keybase.io/shazow) on keybase.
- I have a public key whose fingerprint is 9FCE A980 CCFD 3C13 E11E 88A9 3506 87D1 7E81 FD68
To claim this, I am signing this object:
| # DOCKER-VERSION 0.6.1 | |
| # Borrowed from https://github.com/vvlad/dockerfiles-postgresql-9.3 | |
| # | |
| # First run: | |
| # $ docker build -t postgresql -rm=true . | |
| # $ ID=$(docker run -e "CREATE_DB=foo" -v "path/to/socks:/var/run/postgresql" -d postgresql) | |
| # $ docker wait $ID | |
| # $ docker logs $ID | |
| FROM ubuntu:12.04 |
| storage = {} | |
| class RegistryMeta(type): | |
| def __init__(cls, name, bases, attrs): | |
| super(RegistryMeta, cls).__init__(name, bases, attrs) | |
| id = getattr(cls, 'id', None) | |
| if not id: | |
| return |
| autocmd CursorMoved,CursorMovedI * hi FOW ctermfg=black ctermbg=NONE guifg=#444444 guibg=NONE | |
| call matchadd('FOW', '\%(.*\n\)\{1,20\}\ze\%(.*\n\)\{3\}.*\%#') | |
| call matchadd('FOW', '.*\%#.*\%(\n.*\)\{3\}\zs\%(.*\n\)\{1,20\}') |
| s = socket2.build_opener(socket2.IPv4Resolver(host), port); | |
| s.addsecurewrap = socket.wrap_socket | |
| conn = s.open() |
I hereby claim:
To claim this, I am signing this object:
| from math import ceil | |
| def resize_dimensions(x, y, max_width=None, max_height=None, min_side=None, max_side=None): | |
| if not any([max_width, max_height, min_side, max_side]): | |
| return x, y | |
| original_x, original_y = x, y | |
| priority_width = True | |
| if max_width and x > max_width: |
| import re | |
| from unstdlib import html | |
| _Default = object() | |
| RE_HUMAN_URL = re.compile('^(\w*://)?(www\.)?(.+)/?$') | |
| def human_url(s, max_length=None): |
| from dogpile.cache.api import CacheBackend, NO_VALUE | |
| class DisabledBackend(CacheBackend): | |
| def __init__(self, arguments): | |
| pass | |
| def get(self, key): | |
| return NO_VALUE | |
| def set(self, key, value): |
| """ | |
| Based on code of dogpile.cache.util.function_key_generator(...) but adds support for kw. | |
| Related dogpile.cache bug: https://bitbucket.org/zzzeek/dogpile.cache/issue/43/kw-support-in-function_key_generator | |
| Usage: | |
| from dogpile.cache import make_region | |
| my_region = make_region( | |
| function_key_generator=make_key_generator, |
| // Without caching, or with a memoization wrapper: | |
| func (c *Context) FooApi() (*Result, error) { | |
| return c.apiClient.someGoogleApiQuery.Do() | |
| } | |
| func (c *Context) BarApi(someArg string) (*Result, error) { | |
| return c.apiClient.someGoogleApiQuery.Filter(someArg).Do() | |
| } |