Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark Winterbottom LondonAppDev

View GitHub Profile
@LondonAppDev
LondonAppDev / Vagrantfile
Created Aug 1, 2019
Simple NGINX Vagrant
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
View views.py
def put(self, request, pk=None):
"""Handle updating an object"""
return Response({'method': 'PUT'})
def patch(self, request, pk=None):
"""Handle partial update of object"""
return Response({'method': 'PATCH'})
@LondonAppDev
LondonAppDev / redux.js
Created Mar 4, 2019 — forked from microcipcip/redux.js
Redux simple implementation
View redux.js
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());
};
@LondonAppDev
LondonAppDev / requests_example.py
Created Oct 1, 2018
byob-profiles-api-requests-example
View requests_example.py
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 / GPG and git on macOS.md
Created Jan 29, 2018 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite
View GPG and git on macOS.md

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 / apple_response.json
Created Jan 27, 2018
Apple sign up error response
View apple_response.json
{
"service_errors" : [ {
"code" : "-34607001",
"title" : "Could Not Create Account",
"message" : "An unknown error has occurred."
} ],
"hasError" : true
}
View atom-install-pycode-linter.sh
apm install linter
apm install linter-pycodestyle
You can’t perform that action at this time.