Skip to content

Instantly share code, notes, and snippets.

View LondonAppDev's full-sized avatar

Mark Winterbottom LondonAppDev

View GitHub Profile
class SubVenueModelTest(TestCase):
def test_create_subvenue_and_get_name(self):
location = create_location(2, "Test Location2")
venue = create_venue(name="Test_Venue2",location=location)
sport1 = create_sport("Test")
sub_venue = models.SubVenue()
sub_venue.venue=venue
sub_venue.name="Test Sub Venuexxx"
sub_venue.sports.add(sport1.id)
sub_venue.save()
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 7,
"sequence_id": 7,
"sender_friend_id": 5,
"recipient_friend_id": 1,
@LondonAppDev
LondonAppDev / bootstrap.sh
Created February 7, 2017 08:19
Python REST API bootstrap.sh script
#!/usr/bin/env bash
# Update the apt repos.
sudo apt-get update
# Install required dev packages.
sudo apt-get install -y language-pack-en
sudo apt-get install -y python3-dev python-pip python-dev
# Install virtualenvwrapper
@LondonAppDev
LondonAppDev / atom-install-minimap.sh
Created April 27, 2017 17:10
Atom install Minimap
apm install minimap
@LondonAppDev
LondonAppDev / atom-install-pycode-linter.sh
Created April 27, 2017 17:14
Atom install Pycode Linter
apm install linter
apm install linter-pycodestyle
@LondonAppDev
LondonAppDev / atom-install-pretty-json.sh
Created April 27, 2017 17:17
Atom install Pretty JSON
apm install pretty-json
@LondonAppDev
LondonAppDev / atom-launch-from-terminal.sh
Created April 27, 2017 17:19
Atom launch from Terminal
atom .
@LondonAppDev
LondonAppDev / apple_response.json
Created January 27, 2018 17:28
Apple sign up error response
{
"service_errors" : [ {
"code" : "-34607001",
"title" : "Could Not Create Account",
"message" : "An unknown error has occurred."
} ],
"hasError" : true
}
@LondonAppDev
LondonAppDev / GPG and git on macOS.md
Created January 29, 2018 07:49 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@LondonAppDev
LondonAppDev / requests_example.py
Created October 1, 2018 19:28
byob-profiles-api-requests-example
import requests
TOKEN_ENDPOINT = 'http://127.0.0.1:8000/api/login/'
PROFILE_ENDPOINT = 'http://127.0.0.1:8000/api/profile/'
def get_token(email, password):
"""Retrieve the token for logging in user"""
data = {'username': email, 'password': password}
res = requests.post(TOKEN_ENDPOINT, data=data)