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:
| 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: |
I hereby claim:
To claim this, I am signing this object:
| s = socket2.build_opener(socket2.IPv4Resolver(host), port); | |
| s.addsecurewrap = socket.wrap_socket | |
| conn = s.open() |
| 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\}') |
| 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 |
| # 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 |
| # DOCKER-VERSION 0.6.1 | |
| # Borrowed from https://github.com/vvlad/dockerfiles-postgresql-9.3 | |
| # | |
| # First run: | |
| # $ docker build -t uwsgi -rm=true . | |
| # $ ID=$(docker run -v "path/to/src:/app/src" -v "path/to/socks:/app/socks" -d uwsgi) | |
| # $ docker wait $ID | |
| # $ docker logs $ID | |
| FROM ubuntu:12.04 |
| #!/bin/sh | |
| NAME="$(basename $0)" | |
| ARCH="$(uname -sm)" | |
| tail -n +6 $0 | tar -s "/$ARCH/$NAME/" -zx "$ARCH" | |
| exec $0 $@ | |
| exit | |
| (... tarball ...) |
| // This is getting out of hand, probably a bad idea. | |
| func (c *Client) searchBuffer(command string) (message *irc.Message, err error) { | |
| buffer := make(chan *irc.Message, cap(c.buffer)) | |
| Fill: | |
| for { | |
| select { | |
| case message = <-c.buffer: | |
| if message.Command == command { |
Notes have been moved here: https://github.com/shazow/learning-opengl
Old versions of the notes that were here are still available as revisions of this gist. Previous revision: https://gist.github.com/shazow/d869952642fe081466fa/70d92e7aac66be8ce9217b06d45fc6441af7b06c