Skip to content

Instantly share code, notes, and snippets.

View LondonAppDev's full-sized avatar

Mark Winterbottom LondonAppDev

View GitHub Profile
@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 / Dockerfile
Created December 18, 2018 13:45
C2 Dockerfile
...
# Install dependencies
COPY ./requirements.txt /requirements.txt
RUN apk add --update --no-cache postgresql-client
RUN apk add --update --no-cache --virtual .tmp-build-deps \
gcc libc-dev linux-headers postgresql-dev
RUN pip install -r /requirements.txt
RUN apk del .tmp-build-deps
@LondonAppDev
LondonAppDev / Python.dockerignore
Created May 19, 2021 13:15
Template .dockerignore.
# Git
.git
.gitignore
# Docker
.docker
# Python
app/__pycache__/
app/*/__pycache__/
@LondonAppDev
LondonAppDev / Vagrantfile
Created August 1, 2019 18:55
Simple NGINX Vagrant
# -*- 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
@LondonAppDev
LondonAppDev / views.py
Created June 4, 2019 18:21
C1 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 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());
};
@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 / 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 / atom-launch-from-terminal.sh
Created April 27, 2017 17:19
Atom launch from Terminal
atom .
@LondonAppDev
LondonAppDev / atom-install-pretty-json.sh
Created April 27, 2017 17:17
Atom install Pretty JSON
apm install pretty-json