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 / 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"
@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

▶ 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 / 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]
#
@jonwhittlestone
jonwhittlestone / 10-days-to-a-less-defiant-child.md
Last active August 27, 2022 05:54
10 Days to a Less Defiant Child
<style> strong {background-color: yellow; font-weight:normal}</style>

My notes on "10 Days to a Less Defiant Child"

If children live with hostility they learn to fight. If children live with kindness and consideration, they learn respect. Excerpt from "Child Learn What They Live" by Dorothy Law Nolte.

I found this book to offer pragmatic and practical approaches to understanding and dealing with defiant children. Dr. Jeffrey Bernstein is a licensed psychologist who specalised in child and family therapy. Much of the ideas in this book are backed by research and his case history.

Lisa and I read this at roughly the same time. This proved a useful strategy because we could discuss the content in relation to our day-to-day parenting.

@jonwhittlestone
jonwhittlestone / index.html
Created September 27, 2022 09:18
mkdocs static index tmp
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">