Skip to content

Instantly share code, notes, and snippets.

View jonwhittlestone's full-sized avatar
💭
... cloud hopping

Jon jonwhittlestone

💭
... cloud hopping
View GitHub Profile
@jonwhittlestone
jonwhittlestone / gist:6232111
Last active December 21, 2015 01:59
LAMP Sandbox

LAMP Sandbox


A LAMP sandbox appliance image for use with VirtualBox

Download

Features

@jonwhittlestone
jonwhittlestone / flask-json.py
Created November 14, 2015 09:42
Returning JSON in Flask
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/")
def index():
data = {
"header": [
"Date",
"Payment Id"
▶ docker build -t shakyshane/laravel-app -f ./app.dockerfile .
Sending build context to Docker daemon 721.4 kB
Step 1/8 : FROM shakyshane/laravel-php:latest
---> dd18f9511e64
Step 2/8 : COPY composer.lock composer.json /var/www/
---> Using cache
---> 874dac8074d3
Step 3/8 : COPY database /var/www/database
---> Using cache
---> dd57d56da83e
@jonwhittlestone
jonwhittlestone / gist:f8a995608d3a6402b16c915fa4fd04f6
Last active July 11, 2023 13:00
VIM bindings in Jupyter notebook (Django shell_plus)
See: https://github.com/lambdalisue/jupyter-vim-binding/wiki/Installation
1. pip install jupyter_contrib_nbextensions
2. jupyter nbextensions_configurator enable --use
3. Add the vim binding
# You may need the following to create the directoy
mkdir -p $(jupyter --data-dir)/nbextensions
@jonwhittlestone
jonwhittlestone / pretty_json.py
Created June 10, 2019 12:38
Pretty printing a Django model instance by converting it to json
from django.core import serializers
from product.models import Product, Author
import json
# Pretty Printing a model instance by converting it to JSON
# assuming obj is a model instance
author_id = 6417
products = Product.objects.filter(author_id=author_id)
serialized_obj = serializers.serialize('json', [ products[0], ])
* MORE INFORMAL
- "What are you doing in Python that is exciting you / you consider 'cutting-edge' / what's interesting to you in Python a.t.m
* Do you know what a PEP is 'Zen of Python'? Favourite line from zen of Python and why?
- 'Although never is often better than *right* now.
+ Because it implies that rushing will cause problems until property digested and discussed
* Has your previous Python projects been secure? In what way have you had to optimise for security?
@jonwhittlestone
jonwhittlestone / kaizen_notes.md
Last active August 23, 2019 05:22
Kaizen Notes
@jonwhittlestone
jonwhittlestone / search.json
Created August 23, 2019 14:06
Elasticsearch query for isbn
{
"query": {
"bool": {
"should": [
{
"match": {
"isbn_keyword": "9780008179823"
}
}
]
@jonwhittlestone
jonwhittlestone / do_cloud-config.init.yaml
Created June 8, 2020 05:15 — forked from c0psrul3/do_cloud-config.init.yaml
Digital Ocean cloud-init / cloud-config / droplet metadata usage
#
#DO droplet metadata intro + for DO-API
# [https://www.digitalocean.com/community/tutorials/an-introduction-to-droplet-metadata#how-to-retrieve-droplet-metadata#digitalocean-api]
#
#intro to cloud-config scripting (source of following examples)
# [https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting]
#
#howto
# [https://www.digitalocean.com/community/tutorials/how-to-use-cloud-config-for-your-initial-server-setup]
#
{
"meta": {
"theme": "onepage-plus"
},
"basics": {
"name": "Jon Whittlestone",
"label": "Senior Backend Developer",
"image": "https://i.imgur.com/32x22gS.png",
"summary": "I am a full-stack developer designing, building and maintaining data-intensive apps. I'm a product-focused collaborator who consults with security and user feedback as primary concerns.\r\r Building across the entire stack, I specialise in delivering solutions that enable SaaS companies to retain larger and more valuable subscribers.",
"website": "http://words.howapped.com",