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
| """ This is a simple gist to show how to mock | |
| private methods. I've got lots of questions | |
| regarding this topic. Most people seems confused. | |
| Hope it helps. | |
| """ | |
| import unittest | |
| import mock |
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
| #!bash | |
| # | |
| # bash/zsh completion support for core Git. | |
| # | |
| # Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
| # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
| # Distributed under the GNU General Public License, version 2.0. | |
| # | |
| # The contained completion routines provide support for completing: | |
| # |
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
| [ { "distance" : 1609.3440000000001, | |
| "time" : 466.0 | |
| }, | |
| { "distance" : 1609.3440000000001, | |
| "time" : 420.0 | |
| }, | |
| { "distance" : 1609.3440000000001, | |
| "time" : 421.0 | |
| }, | |
| { "distance" : 1609.3440000000001, |
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
| package com.athlete.com.api.clients.api_java_client; | |
| import java.io.File; | |
| import java.io.IOException; | |
| //http://developer.android.com/reference/org/apache/http/HttpEntity.html | |
| import org.apache.http.HttpEntity; | |
| // New headers | |
| import org.apache.http.Header; | |
| import org.apache.http.message.BasicHeader; |
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
| """ | |
| You find yourself doing this all the time? | |
| >>> car = Car.objects.get(id=1) | |
| >>> if c.user != request.user: | |
| >>> return HttpResponse("This car doesn't belong to you") | |
| >>> c.brand = request.POST.get('brand_name') | |
| >>> c.save() | |
| Better to turn it into: |
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
| santiago@santiago-desktop:~$ | |
| >> curl -XGET -vv http://www.ole.com.ar > /dev/null | |
| * About to connect() to www.ole.com.ar port 80 (#0) | |
| * Trying 200.42.93.137... % 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 www.ole.com.ar (200.42.93.137) port 80 (#0) | |
| > GET / 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 |
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
| [ | |
| { | |
| "lat":37.1571709, | |
| "lng":-113.634999, | |
| "elev":901.197369863, | |
| "time":"2012-07-05T17:00:00Z" | |
| }, | |
| { | |
| "lat":37.1571478, | |
| "lng":-113.6349291, |
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
| ====================================================================== | |
| ERROR: test_post_a_workout_from_GPX (athlete.test.api.resources.workouts.TestWorkoutCreation) | |
| ---------------------------------------------------------------------- | |
| Traceback (most recent call last): | |
| File "/home/santiago/code/python/athlete/athlete/src/athlete/test/api/resources/workouts.py", line 143, in test_post_a_workout_from_GPX | |
| response = self.workout_resource.dispatch_list(request) | |
| File "/home/santiago/.virtualenvs/athlete.com/src/django-tastypie/tastypie/resources.py", line 407, in dispatch_list | |
| return self.dispatch('list', request, **kwargs) | |
| File "/home/santiago/.virtualenvs/athlete.com/src/django-tastypie/tastypie/resources.py", line 436, in dispatch | |
| response = method(request, **kwargs) |
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
| Running migrations for routes: | |
| - Migrating forwards to 0015_auto__chg_field_route_distance_in_meters. | |
| > routes:0010_auto__unify_route_data | |
| > routes:0011_unify_route_data | |
| - Migration 'routes:0011_unify_route_data' is marked for no-dry-run. | |
| ! Error found during real run of migration! Aborting. | |
| ! Since you have a database that does not support running | |
| ! schema-altering statements in transactions, we have had | |
| ! to leave it in an interim state between migrations. |
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
| <?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> |