Skip to content

Instantly share code, notes, and snippets.

View santiagobasulto's full-sized avatar

Santiago Basulto santiagobasulto

View GitHub Profile
@santiagobasulto
santiagobasulto / gist:3524234
Created August 30, 2012 08:35
GPX sample with pauses
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="Exported from Strava"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1
http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1"
xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata>
<link href="http://cosmocatalano.com/strava/export">
<text>Strava GPX Exporter - Version 2</text>
@santiagobasulto
santiagobasulto / gist:3525174
Created August 30, 2012 09:57
Valid Workout description
{
"run_date":"1970-01-01T00:00:00Z",
"title":"Run Title!",
"run_type":"Endurance",
"duration_in_seconds":3600,
"distance_in_meters":1000,
"post_body":"This is the body, in order to provide a full description of your run",
"privacy":"public",
"points":[
{
@santiagobasulto
santiagobasulto / friendship_translation
Created September 18, 2012 10:29
Friendship. By Ralph Waldo Emerson
# A ruddy drop of manly blood
Una gota rubicunda de sangre varonil
# The surging sea outweighs,
La olead del mar sobrepasa
# The world uncertain comes and goes;
El mundo incierto viene y seva
# The lover rooted stays.
El amante arraigado permanece
# I fancied he was fled,-
Yo fantasee que había huido
@santiagobasulto
santiagobasulto / gist:3778889
Created September 24, 2012 22:39
Sublime conf
{
"auto_complete": false,
"bold_folder_labels": true,
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"fold_buttons": false,
"folder_exclude_patterns":
{'description': 'Sep 30-Oct 6',
'group_url': '/stats/1/santiago-basulto/2012/09/30',
'is_max': True, # Possibly getting this when the doc is fetched
'max_distance_in_meters': Decimal('17454.835578'), # Possibly getting this when the doc is fetched
'total_distance_in_meters': Decimal('79015.883629'),
'total_duration_in_seconds': 25869,
'workouts': [{'date': 'Mon 1',
'distance_in_meters': Decimal('16630.901309'),
'duration_in_seconds': 6740,
'has_picture': False,
[user]
name = Santiago Basulto
email = [email protected]
[credential]
helper = cache
[color]
ui = true
[alias]
st = status
cm = commit
@register_segment
class FeedPostsByTypeCacheSegmentForAPI(FeedPostsByTypeCacheSegment):
def load(self):
feed_type, posts = get_feed_posts_by_type(
self.user,
self.feed_type,
self.after_pk,
include_friendship_posts=False
)
return [feed_type, posts]
>> curl -XGET -vv -b athletetester=1 "http://staging.athlete.com/stats/run/727/shorty-on-legacy-9222012-1050am" > /dev/null
* About to connect() to staging.athlete.com port 80 (#0)
* Trying 23.23.237.39... % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected
* Connected to staging.athlete.com (23.23.237.39) port 80 (#0)
> GET /stats/run/727/shorty-on-legacy-9222012-1050am HTTP/1.1
> User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.21.6 OpenSSL/1.0.0e zlib/1.2.3.4 libidn/1.22 librtmp/2.3
> Host: staging.athlete.com
> Accept: */*
@santiagobasulto
santiagobasulto / gist:3868332
Created October 10, 2012 20:50
PDB templatetag
from django.template import Library, Node
register = Library()
try:
import ipdb as pdb
except ImportError:
import pdb
@santiagobasulto
santiagobasulto / gist:3987527
Created October 31, 2012 15:02
Local settings
from athlete.settings.development import LOGGING, DATABASES, TEST_MODE, DEBUG, CACHES
if not TEST_MODE:
DATABASES['default'] = {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'athlete',
'USER': 'athlete',
'PASSWORD': 'athlete',
'HOST': 'localhost',
'PORT': '',