Skip to content

Instantly share code, notes, and snippets.

View thruflo's full-sized avatar

James Arthur thruflo

View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Provides ``PostmarkMailer`` utility for sending emails. Instantiate with
an api_key::
api_key = '...'
mailer = PostmarkMailer(api_key)
Then fire away::

So (!) if I remember right, the idea was to make a mobile app where:

  • foursquare users are 'fodder'
  • you rack up kill points by massacring venues with foursquare users in them
  • kill points unlock better weaponry
  • massacring the mayor gets more kill points (perhaps you become the 'slayer')
  • massacring other massacrers earns you their points (bit like playing conkers)

I've taken the all important step of registering http://massacr.com. That's the bulk of the work done but I guess we'd also need:

# Jasmine specs for controllers go here
describe 'PhoneCat controllers', ->
describe 'PhoneListCtrl', ->
data = [name: 'Nexus S', name: 'Motorola DROID']
beforeEach =>
@scope = angular.scope()
@browser = @scope.$service '$browser'
request = @browser.xhr.expectGET 'phones/phones.json'
request.respond data
@ctrl = @scope.$new PhoneListCtrl
@thruflo
thruflo / query snippet.py
Created December 9, 2011 18:33
Distance query snippet.
# Get a query for all `Message`s.
query = Message.query
# Get the query parameters (in this example from a `request` object).
params = request.params
lat = params['latitude']
lng = params['longitude']
distance = params.get('distance', None)
# Generate the `within` clause to filter by, either using a `distance`
@thruflo
thruflo / client.coffee
Created December 9, 2011 17:45
Example location slider and page view for a filter by proximity UI.
# Starting with `$ ->` means the code is executed after the dom ready event.
$ ->
# `LocationBar` applies dynamic behaviour to a jQuery Mobile slider widget,
# notifying when the slider position changes in response to user input
# and updating the slider position whenever its distance value changes.
#
# N.b.: we use a very very exponential curve so that at low distance values,
# a few pixels corresponds to a few hundred meters, while at high values
# a few pixels corresponds to many kilometers. This makes the slider

Live Client

  • each client holds open one primary and potentially multiple secondary connections

  • subscribe(qid, callback):

    • stores an item mapping qid to callback
    • opens a secondary_channel with qid
    • stores an item mapping qid to secondary_channel

Trustmap Impl

Three types of query:

  • direct trustmap
  • computed trustmap
  • everyone

When a user joins context:

@thruflo
thruflo / Togethr Pivotal Tracker Snapshot.csv
Created December 4, 2011 12:50
Snapshot of the (rarely used) Togethr pivotal tracker stories on Sunday 4th December 2011
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
Id,Story,Labels,Iteration,Iteration Start,Iteration End,Story Type,Estimate,Current State,Created at,Accepted at,Deadline,Requested By,Owned By,Description,URL,Note
19725001,PyPy Ctypes Support,"@tav, #python",1,"Oct 24, 2011","Oct 30, 2011",feature,2,accepted,"Oct 15, 2011","Oct 24, 2011",,tav,,"In order to use existing code like [pybonjour][] under PyPy, its `ctypes`
support needs to be improved a little.
**Done:**
* The [necessary][] [changes][] have now been committed to [PyPy][].
[pybonjour]: http://pypi.python.org/pypi/pybonjour
[necessary]: https://github.com/pypy/pypy/commit/ec8ef738ba5f648653d195d95f9db5d70dcd172d

We need to design and develop Hub App. The plan is to base it on Togethr, presumably in order to:

  • take advantage of the work done on Togethr
  • drive usage of and resource the further development of Togethr
  • generally focus the two efforts in the same direction

However, the features required for a collaboration app don't map exactly onto Togethr and Togethr is currently far too complicated to articulate without getting a headache. The blurred concepts of context/space/place are confusing. It's not clear how users change and filter contexts. Implicit proximity filtering makes less sense the more users dig into the app.

I suggest we revise Togethr in line with the requirements of the collaboration app:

# ...
S:
C:
Q:
* ...
* ...
* ...