Skip to content

Instantly share code, notes, and snippets.

Traceback (most recent call last):
File "/home/ubuntu/.virtualenvs/gb/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/ubuntu/.virtualenvs/gb/local/lib/python2.7/site-packages/newrelic-1.4.0.137/newrelic/api/object_wrapper.py", line 166, in __call__
self._nr_instance, args, kwargs)
File "/home/ubuntu/.virtualenvs/gb/local/lib/python2.7/site-packages/newrelic-1.4.0.137/newrelic/hooks/framework_django.py", line 447, in wrapper
return wrapped(*args, **kwargs)
@cooncesean
cooncesean / it-django.po
Created December 18, 2013 01:00
Django Italian Translation File
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
@cooncesean
cooncesean / proxy.md
Created December 12, 2013 21:55
Guidebook game proxies
  1. Billy Vopinek: Billy introduced me to Guidebook and I'd like to repay the favor... by forcing him to particpate in a game against his will, solely for my benefit.
  2. Leland Takamine: Its the season of giving, and I honored that tradition last night by letting Leland beat me at foosball. The time has come for him to repay the favor.
  3. Anna Sawyer: Anna won a minature compost bin at the Recology meeting yesterday because she pulled the 'ol "1 dollar more" move -- she'll be perfect.
@cooncesean
cooncesean / psuedocode.py
Created December 11, 2013 06:17
First hack at "dynamic" urlpatterns.
# gears/urls.py =>
from corpsite.kr.urls import urlpatterns as corp_kr_urlpatterns
# corpsite/base_urls.py
BASE_PATTERNS = [
{
'regex': r'^guide/(?P<guide_id>[0-9]+)/delete/$',
'view': 'path.to.some.view', # missing
'name': 'delete-guide' # semi-known
},
@cooncesean
cooncesean / output.txt
Created December 10, 2013 21:41
url test results
TOTAL PATTERNS: 483
=================================
RESPONSE CODES:
Response 200 [211]
Response 404 [3]
Response 301 [1]
Response 302 [68]
=================================
EXCEPTIONS:
Exception <class 'appsubmit.models.DoesNotExist'> [['^g/(?P<guideShortName>[\\w-]+)/$']]
{
"pep8_max_line_length": 150,
"pep8_ignore":
[
"E302", "W191"
]
}
@cooncesean
cooncesean / sample.config.py
Last active December 30, 2015 09:49
Sample config file to handle dependency switching between multiple branches.
# Each key maps to a branch in `gears` that depends on branched code in other repos.
#
# When developing a new `gears` feature (typically done in a feature branch) that depends on
# branched code outside of gears, this file would modified to specify the configuration for
# that branch.
#
# Our tool referenced this file when staging code or when configuring a developer's environment.
# Staging Code:
# > fab stage gears:master # would stage master and the appropriate branches of its dependent repos
# > fab stage gears:feature_branch_1 # would stage gears `feature_branch_1` and the appropriate branches of its dependent repos
@cooncesean
cooncesean / transcode.py
Created October 1, 2013 23:18
Sample Elastic Transcoder script ... How can I set the output files to be publicly available?
"""
This script assumes an s3 hierarchy like:
* bucket
/uploads
/pending # all unprocessed ('raw') files live here. these files are moved to `processed` after they have been transcoded
/processed # the raw file is moved here after it has been sent to the transcoder
/web # each transcoded 'web' file is sent here
/mobile # each transcoded 'mobile' file is sent here
"""
@cooncesean
cooncesean / start-foo.plist
Last active December 23, 2015 09:49
Sample .plist document to run a shell script at system startup
<!-- STARTS THE `capture_videos` SCRIPT ON STARTUP -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>start-foo</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
@cooncesean
cooncesean / pyserial.write.py
Created September 13, 2013 02:47
pyserial write() method.
class Serial(object):
....
def write(self, data):
"""Output the given string over the serial port."""
if not self._isOpen: raise portNotOpenError
t = len(data)
d = data
if self._writeTimeout is not None and self._writeTimeout > 0:
timeout = time.time() + self._writeTimeout
else: