Skip to content

Instantly share code, notes, and snippets.

View cheradenine's full-sized avatar

John Burkhardt cheradenine

View GitHub Profile
# Generated by Django 2.2 on 2019-12-19 13:58
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields
import taggit.managers
class Migration(migrations.Migration):
@cheradenine
cheradenine / elide_pages
Created May 13, 2020 10:27
Fancy Django pagination that elides pages outside range of current page
from django import template
register = template.Library()
@register.filter('elide_pages')
def elide_pages(range, cur_page):
pages = []
skip = False
for p in range:
if p <= 2 or p >= range.stop - 2:
@cheradenine
cheradenine / keybase.md
Created February 25, 2019 11:19
keybase identity proof

Keybase proof

I hereby claim:

  • I am cheradenine on github.
  • I am zakalwe (https://keybase.io/zakalwe) on keybase.
  • I have a public key ASDcVtRqihDaoscTqvxA3kuK2vai_PUgI70GJKlI4KIZxwo

To claim this, I am signing this object: