This file contains hidden or 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
| from tastypie import fields | |
| from tastypie.authentication import Authentication | |
| from tastypie.authorization import Authorization | |
| from tastypie.bundle import Bundle | |
| from tastypie.exceptions import NotFound | |
| from tastypie.resources import Resource | |
| # a dummy class representing a row of data | |
| class Row(object): |
This file contains hidden or 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
| API, POST, JSON | |
| URI: /api/report/by/urlandtype | |
| data = { | |
| 'url': 'location' # http://www.example.com/page?query#hash | |
| 'authKey': '...', | |
| 'apiKey': '...', | |
| 'tracker':, '...', | |
| 'type': 'clickmap|heatmap|foldmap', |
This file contains hidden or 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
| .DS_Store | |
| *.~ | |
| *.swp | |
| *.pyc | |
| *.backup | |
This file contains hidden or 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
| from django.core.cache import cache | |
| from django.http import HttpResponseForbidden | |
| from functools import wraps | |
| from django.utils.decorators import available_attrs | |
| def ratelimit(limit=10,length=86400): | |
| """ The length is in seconds and defaults to a day""" | |
| def decorator(func): | |
| def inner(request, *args, **kwargs): | |
| ip_hash = str(hash(request.META['REMOTE_ADDR'])) |
This file contains hidden or 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
| #!/bin/sh | |
| # ================================================================ | |
| # | |
| # Convert a mysql database dump into something sqlite3 understands. | |
| # | |
| # Adapted from | |
| # http://stackoverflow.com/questions/489277/script-to-convert-mysql-dump-sql-file-into-format-that-can-be-imported-into-sqlit | |
| # | |
| # (c) 2010 Martin Czygan <martin.czygan@gmail.com> |
NewerOlder