This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Splitwise keybindings | |
// @version 0.1 | |
// @description adds two keybindings to splitwise | |
// @match https://secure.splitwise.com | |
// @require http://cdn.craig.is/js/mousetrap/mousetrap.min.js | |
// @downloadURL https://gist.githubusercontent.com/arshaver/9999759/raw/ | |
// ==/UserScript== | |
Mousetrap.bind('b', function(e, combo) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> | |
<meta> | |
<author>Own3d</author> | |
<description>Own3d's API</description> | |
<documentationURL>none</documentationURL> | |
<sampleQuery>select * from {table} where limit = "20"</sampleQuery> | |
</meta> | |
<bindings> | |
<select itemPath="rss.channel.item" produces="XML"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> | |
<meta> | |
<author>Justin.tv</author> | |
<description>Justin.tv's API</description> | |
<documentationURL>none</documentationURL> | |
<sampleQuery>select * from {table} where category = "gaming" and limit = "20"</sampleQuery> | |
</meta> | |
<bindings> | |
<select itemPath="streams" produces="XML"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def jsonp(f): | |
"""Wrap a json response in a callback, and set the mimetype (Content-Type) header accordingly | |
(will wrap in text/javascript if there is a callback). If the "callback" or "jsonp" paramters | |
are provided, will wrap the json output in callback({thejson}) | |
Usage: | |
@jsonp | |
def my_json_view(request): | |
d = { 'key': 'value' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#adapted from http://nigel.jp/2011/06/jsonp-with-django/ | |
#JsonpResponse object | |
import json | |
from django.http import HttpResponse | |
class JsonpResponse(HttpResponse): | |
def __init__(self, data, callback): | |
json = json.dumps(data) | |
jsonp = "%s(%s)" % (callback, json) | |
HttpResponse.__init__( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<document> | |
<location> | |
<name>Paris</name> | |
<latitude>48.856667</latitude> | |
<longitude>2.350987</longitude> | |
<type>an</type> | |
<target></target> | |
<imageurl></imageurl> | |
<description>France</description> | |
</location> |