Skip to content

Instantly share code, notes, and snippets.

View jackiect's full-sized avatar
💭
I may be slow to respond.

Jack jackiect

💭
I may be slow to respond.
View GitHub Profile
@jackiect
jackiect / json.py
Created March 18, 2021 03:24 — forked from amacneil/json.py
Safely JSON-encode objects in your Django template
from django.core.serializers.json import DjangoJSONEncoder
from django.template import Library
from json import dumps as json_dumps
register = Library()
@register.filter
def json(data):
"""
@jackiect
jackiect / web-servers.md
Last active November 19, 2020 10:37 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jackiect
jackiect / django_jwt_cookie.py
Created October 28, 2020 16:03 — forked from elnygren/django_jwt_cookie.py
Teach Django to use JWT tokens inside the session cookie - plays well with django-rest-framework-jwt.
@jackiect
jackiect / docker-machine-install-docker-compose.sh
Created July 24, 2020 05:14 — forked from jan-swiecki/docker-machine-install-docker-compose.sh
Installs docker-compose inside docker-machine
#!/bin/sh
# Installs docker-compose inside docker-machine
DOCKER_COMPOSE_VERSION=1.6.0
# Download docker-compose to the permanent storage
echo 'Downloading docker-compose to the permanent VM storage...'
sudo mkdir -p /var/lib/boot2docker/bin
sudo curl -sL https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /var/lib/boot2docker/bin/docker-compose