I hereby claim:
- I am djm on github.
- I am djm (https://keybase.io/djm) on keybase.
- I have a public key whose fingerprint is DBB9 0727 AD94 8582 ECED 66EB 7EA3 B5B0 D8AD 79BB
To claim this, I am signing this object:
| javascript:(function(){$(".load-diff").click();}()); |
| // Get Card's last URL segment (eg 4468-fix-the-login-page): | |
| javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('', window.location.href.split("/").pop().split("#")[0])})() | |
| // Get Card's full hash (eg 5731b92ef660293533517de9) : | |
| javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}$('.js-more-menu').click(); prompt('', $('.js-export-json').attr('href').split("/")[2]); $('.js-more-menu').click();})() | |
| // Get Card's unique id (board-independent, eg rKBmQeOk) : | |
| javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}$('.js-more-menu').click(); prompt('', $('.js-short-url').attr('value').split("/").slice(-1)[0]); $('.js-more-menu').click();})() |
| #!/usr/bin/env python | |
| import sys, subprocess, collections | |
| from flake8.hooks import git_hook, get_git_param | |
| # `get_git_param` will retrieve configuration from your local git config and | |
| # then fall back to using the environment variables that the hook has always | |
| # supported. | |
| # For example, to set the complexity, you'll need to do: | |
| # git config flake8.complexity 10 | |
| COMPLEXITY = get_git_param('FLAKE8_COMPLEXITY', 10) |
I hereby claim:
To claim this, I am signing this object:
| import time | |
| from boto import elastictranscoder | |
| REQUEST_FREQ = 0.3 # Every x seconds | |
| REGION = 'eu-west-1' | |
| TO_CANCEL = [ | |
| 'Progressing', | |
| 'Submitted' | |
| ] |
| export function chunkMap (map, chunkSize) { | |
| const chunkedMaps = [] | |
| const mapAsArray = Array.from(map) | |
| for (var i = 0; i < map.size; i += chunkSize) { | |
| let chunked = mapAsArray.slice(i, i + chunkSize) | |
| chunkedMaps.push(new Map(chunked)) | |
| } | |
| return chunkedMaps | |
| } |
| Reading zip file to memory | |
| Uploading zip file to AWS Lambda eu-west-1 with parameters: | |
| { FunctionName: 'xxx-staging-1-0-0', | |
| FunctionZip: <Buffer 50 478 0b 00 ...>, | |
| Handler: 'index.handler', | |
| Mode: 'event', | |
| Role: 'arn:aws:iam::xxx:role/xxx', | |
| Runtime: 'nodejs', | |
| Description: 'Resizes images for the xxx project.', | |
| MemorySize: '512', |
| # Bad | |
| class Join(object): | |
| """ | |
| >>> join_by_commas = Join(',') | |
| >>> join_by_commas(['o', 'm', 'g']) | |
| 'o,m,g' | |
| """ | |
| def __init__(self, separator=u' '): | |
| self.separator = separator |
| FROM python:2.7 | |
| # Force stdin, stdout and stderr to be totally unbuffered. | |
| ENV PYTHONUNBUFFERED 1 | |
| # For Pillow to have freetype support. | |
| RUN ln -s /usr/include/freetype2 /usr/include/freetype | |
| RUN mkdir -p /usr/src/app | |
| WORKDIR /usr/src/app |
| #!/usr/bin/env python -i | |
| """ | |
| A local interactive IPython shell for Google App Engine on Mac OSX. | |
| Usage: | |
| cd /to/project/folder/with/app.yaml | |
| python gae_shell.py | |
| Notes: |