Skip to content

Instantly share code, notes, and snippets.

View robgolding's full-sized avatar

Rob Golding-Day robgolding

View GitHub Profile
[{"id": 0}, {"id": 1}, {"id": 2}, {"id": 3}, {"id": 4}, {"id": 5}, {"id": 6}, {"id": 7}, {"id": 8}, {"id": 9}, {"id": 10}, {"id": 11}, {"id": 12}, {"id": 13}, {"id": 14}, {"id": 15}, {"id": 16}, {"id": 17}, {"id": 18}, {"id": 19}, {"id": 20}, {"id": 21}, {"id": 22}, {"id": 23}, {"id": 24}, {"id": 25}, {"id": 26}, {"id": 27}, {"id": 28}, {"id": 29}, {"id": 30}, {"id": 31}, {"id": 32}, {"id": 33}, {"id": 34}, {"id": 35}, {"id": 36}, {"id": 37}, {"id": 38}, {"id": 39}, {"id": 40}, {"id": 41}, {"id": 42}, {"id": 43}, {"id": 44}, {"id": 45}, {"id": 46}, {"id": 47}, {"id": 48}, {"id": 49}, {"id": 50}, {"id": 51}, {"id": 52}, {"id": 53}, {"id": 54}, {"id": 55}, {"id": 56}, {"id": 57}, {"id": 58}, {"id": 59}, {"id": 60}, {"id": 61}, {"id": 62}, {"id": 63}, {"id": 64}, {"id": 65}, {"id": 66}, {"id": 67}, {"id": 68}, {"id": 69}, {"id": 70}, {"id": 71}, {"id": 72}, {"id": 73}, {"id": 74}, {"id": 75}, {"id": 76}, {"id": 77}, {"id": 78}, {"id": 79}, {"id": 80}, {"id": 81}, {"id": 82}, {"id": 83}, {"id": 84}, {"id": 85}, {

Keybase proof

I hereby claim:

  • I am robgolding on github.
  • I am robgolding (https://keybase.io/robgolding) on keybase.
  • I have a public key ASDMf0dMe-fP7O_Llmkwg0XESGmWiG3VCG3-K9AL8ieWNwo

To claim this, I am signing this object:

@robgolding
robgolding / lazy_loaded_list.py
Last active November 7, 2021 07:06
Python Collections ABC
import collections
class LazyLoadedList(collections.Sequence):
def __init__(self, url):
self.url = url
self.page = 0
self.num_items = 0
self.store = []
import signal
import time
def shutdown():
client.stop()
sys.exit(0)
signal.signal(signal.SIGINT, shutdown)
try:

Keybase proof

I hereby claim:

  • I am robgolding63 on github.
  • I am robgolding (https://keybase.io/robgolding) on keybase.
  • I have a public key whose fingerprint is 521E AD24 5315 B7F9 0B10 8C40 847C 44D3 13A6 D5DA

To claim this, I am signing this object:

@robgolding
robgolding / filtering.py
Created November 17, 2012 16:44
Django Class-Based View Mixins: Part 2
class FilterMixin(object):
"""
View mixin which provides filtering for ListView.
"""
filter_url_kwarg = 'filter'
default_filter_param = None
def get_default_filter_param(self):
if self.default_filter_param is None:
raise ImproperlyConfigured(
@robgolding
robgolding / dog.sh
Created July 18, 2012 15:57
A simple watchdog script in Python
#!/usr/bin/env python
import os
import sys
import re
import time
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
ignore = (
@robgolding
robgolding / login_required.py
Created July 11, 2012 19:25
Django Class-Based View Mixins: Part 1
class LoginRequiredMixin(object):
"""
View mixin which requires that the user is authenticated.
"""
@method_decorator(login_required)
def dispatch(self, request, *args, **kwargs):
return super(LoginRequiredMixin, self).dispatch(
self, request, *args, **kwargs)
@robgolding
robgolding / models.py
Created June 24, 2011 16:53
Custom Fields proposed implementation
from django.db import models
from django.contrib.contenttypes.models import ContentType
CUSTOMFIELD_TYPE_CHOICES = (
('bool', 'boolean'),
('char', 'text'),
('int', 'integer'),
('float', 'decimal'),
)
@robgolding
robgolding / G52CFJ Makefile
Created March 15, 2011 20:26
A simple Makefile for the G52CFJ coursework
CXX = g++
CXXFLAGS = -g $$(sdl-config --cflags --libs) -lSDL_image -lSDL_ttf
SOURCES = \
BaseEngine.cpp \
BouncingBall.cpp \
BouncingBallMain.cpp \
DisplayableObject.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=game