Skip to content

Instantly share code, notes, and snippets.

View sonlinux's full-sized avatar
🦅
hatua moja karibu

Alison Mukoma sonlinux

🦅
hatua moja karibu
View GitHub Profile
@sonlinux
sonlinux / keybase.md
Last active March 3, 2021 22:18
### Keybase proof

Keybase proof

I hereby claim:

  • I am sonlinux on github.
  • I am sonlinux (https://keybase.io/sonlinux) on keybase.
  • I have a public key ASCfmWx5r2-XwXkMMcDM33TNj-R-8eV0r1OKA4QHNyfuFAo

To claim this, I am signing this object:

class ShippingMethodView(View):
def set_default_shipping_method(self):
self.methods = self.get_available_shipping_methods()
if not self.is_shipping_method_set(self.request.basket):
shipping_method_code = self.get_shipping_method_code(
self.request.basket)
method_set = False
if len(self.methods) >= 1:
for method in self.methods:
from datetime import datetime
appointments = [
(datetime(2012, 5, 22, 10), datetime(2012, 5, 22, 10, 30)),
(datetime(2012, 5, 22, 12), datetime(2012, 5, 22, 12, 30)),
(datetime(2012, 5, 22, 15, 00), datetime(2012, 5, 22, 15, 30))]
booking_requests = [
(datetime(2012, 5, 22, 10, 45), datetime(2012, 5, 22, 11, 00)),
(datetime(2012, 5, 22, 11, 45), datetime(2012, 5, 22, 12, 45)),]
@sonlinux
sonlinux / mixin.py
Created January 31, 2019 23:34 — forked from cyberdelia/mixin.py
Django class based view mixins
# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.utils.cache import patch_response_headers
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page, never_cache
from django.views.decorators.csrf import csrf_exempt
class NeverCacheMixin(object):
@method_decorator(never_cache)
@sonlinux
sonlinux / SACRS.md
Created March 1, 2018 13:22 — forked from gubuntu/SACRS.md
southern African coordinate reference systems (CRS) definitions in proj4 and WKT

Use this file to get the CRS definitions you need in southern Africa, particularly South Africa, Lesotho, Swaziland and Zimbabwe.

Most GIS software now implements the South African CRS (SACRS; incorrectly but popularly known as the "LO" system) which is based on south-oriented (or south-facing) transverse mercator (TMSO). The EPSG codes for these are:

  • odd numbers from 22275 to 22293 for the Cape datum
  • all numbers from 2046 to 2055 for the Hartebeesthoek94 or WGS84 datum.

If you have data in one of these south-oriented CRSs it will draw upside down and back to front in its native CRS but if you have on-the-fly transformation enabled, your layers will overlay your other data perfectly in whatever project CRS you choose. This feature request will result south-oriented coordinates and visualisation being more intutitive to GIS users.

Note on datums: Although there are a few metres difference between the WGS84 and Hartebeethoek94 datums, for all intents and purpos