Skip to content

Instantly share code, notes, and snippets.

View LondonAppDev's full-sized avatar

Mark Winterbottom LondonAppDev

View GitHub Profile
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 7,
"sequence_id": 7,
"sender_friend_id": 5,
"recipient_friend_id": 1,
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()
@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 / 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)
@LondonAppDev
LondonAppDev / redux.js
Created March 4, 2019 11:55 — forked from microcipcip/redux.js
Redux simple implementation
function createStore(reducer, initialState) {
let state = initialState;
const listeners = [];
const subscribe = listener => listeners.push(listener);
const getState = () => state;
const dispatch = action => {
state = reducer(state, action);
listeners.forEach(l => l());
};