Skip to content

Instantly share code, notes, and snippets.

View tipabu's full-sized avatar

Tim Burke tipabu

  • San Francisco, CA
View GitHub Profile
@tipabu
tipabu / demo.svg
Last active January 27, 2016 00:15
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tipabu
tipabu / games.sh
Created April 22, 2016 18:09
Get the next ten Giants home games
#!/bin/sh
curl http://sanfrancisco.giants.mlb.com/ticketing-client/json/EventTicket.tiksrv \
-s -G -d team_id=137 \
-d venue_id=2395 \
-d site_section=SCHEDULE \
-d begin_date=`date +"%Y%m%d"` | \
jq -r '.events.game | limit(10; .[]) |
"\(.game_time_home) \(.away_name_full)" '
def filter_factory(gc, **lc):
def no_range_filter(app):
def filter_app(env, start_response):
env.pop('HTTP_RANGE', None)
return app(env, start_response)
return filter_app
return no_range_filter
from __future__ import division
from __future__ import print_function
from collections import OrderedDict
import json
import logging
import os
import time
import requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A Python gibberizer for (swift) locale strings.
This will extract all of the strings currently marked for translation,
swap some of the ASCII letters (like 'A') for non-ASCII look-alikes (like 'Á'),
extend them with some padding characters to test label-widths, and
create *.po and *.mo files that may be used by Python's gettext.

Keybase proof

I hereby claim:

  • I am tipabu on github.
  • I am timothyburke (https://keybase.io/timothyburke) on keybase.
  • I have a public key ASAvi95OT2fGYzjF915uGqrog-aVFBREh3z2TA7FRwNZugo

To claim this, I am signing this object:

@tipabu
tipabu / .s3cfg
Last active October 6, 2016 18:13
[default]
access_key = <ec2 credential access>
use_https = <defaults to True; set to False if using plain old http://>
host_base = <swift endpoint, like "hostname" or "hostname:port">
host_bucket = <swift endpoint, same as above>
secret_key = <ec2 credential secret>
signature_v2 = True
import logging
import keystoneauth1.loading
import keystoneauth1.session
import swiftclient.client
use_v1 = True
do_preauth = False
bad_preauth = False
if use_v1:
#!/usr/bin/env python
from __future__ import unicode_literals
import argparse
import cmd
import hashlib
import shlex
import socket
try:
import readline # noqa
#!/usr/bin/env python
import struct
import sys
import zlib
def check_archive(fragment_archive):
with open(fragment_archive, 'rb') as fp:
meta = fp.read(59)
if len(meta) != 59:
raise ValueError('Incomplete metadata!')