Skip to content

Instantly share code, notes, and snippets.


Ashley Felton ropable

View GitHub Profile
Tras2 /
Last active Dec 4, 2021
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
Prototype-X /
Last active Jan 14, 2021 — forked from delameko/
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04


Install Postgres 9.6, and then:

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main

Set db path for pg_upgradecluster:

danni /
Created Mar 8, 2016
Multi Choice Django Array Field
from django import forms
from django.contrib.postgres.fields import ArrayField
class ChoiceArrayField(ArrayField):
A field that allows us to store an array of choices.
Uses Django 1.9's postgres ArrayField
and a MultipleChoiceField for its formfield.
miraculixx /
Last active Jan 12, 2019
To enable CORS support in django-tastypie, use the following code snipet. Then create your tastypie resources as a subclass of BaseCorsResource.Basic code courtesy Daniel Conzalez of added documentation and the post_list method.
Add CORS headers for tastypie APIs
class MyModelResource(CORSModelResource):
class MyResource(CORSResource):
willurd /
Last active Dec 4, 2021
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
wpscholar / jquery.external-links-new-window.js
Last active Aug 15, 2020
Open all external links in a new window
View jquery.external-links-new-window.js