Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Kunze rixx

View GitHub Profile
@rixx
rixx / models.py
Created Aug 2, 2017
Django Url Considerations
View models.py
from django.db import models
from urlman import NamedUrls
class Event(models.Model):
code = models.CharField(max_length=20)
class urls(NamedUrls):
base = 'orga:event.list'
detail = 'orga:event.view', {'event': self.code}
View keybase.md

Keybase proof

I hereby claim:

  • I am rixx on github.
  • I am rixx (https://keybase.io/rixx) on keybase.
  • I have a public key ASDSgbthxeP9hBggbdd7FMbQjKNL5zCBJumGVUtGRwDsawo

To claim this, I am signing this object:

@rixx
rixx / urls.py
Created Jun 18, 2018
Delivering static files on fixed URL in Django
View urls.py
import os
from django.http import Http404, FileResponse
def get_static(request, path, content_type):
path = os.path.join(settings.BASE_DIR, 'pretalx/static', path)
if not os.path.exists(path):
raise Http404()
return FileResponse(open(path, 'rb'), content_type=content_type)
View covsource.py
import sqlite3
import sys
def usage():
print("Usage: covsource.py <file> <linenos>")
print(" e.g. covsource.py foo/bar.py 14,15\n")
print(" or covsource.py foo/bar.py 14-27\n")
sys.exit(1)
@rixx
rixx / get_tickets.py
Created Jun 25, 2019
Getting tickets from Django's trac and putting them into an SQLite database – results at https://data.rixx.de
View get_tickets.py
import json
import sqlite3
from datetime import datetime
import requests
BASE_URL = "https://code.djangoproject.com/jsonrpc"
DJANGO_MAX_TICKET = 30588
View notify.cfg
[zammad]
token = secrettoken
url = https://my.domain.com
[pushover]
user = secretusertoken
app = secretapptoken
@rixx
rixx / comparison.md
Last active Jan 12, 2020
Online man pages comparison
View comparison.md

Man page browser comparison

There are a bunch of man page browsers available online. They have different data sources, feature sets, and disadvantages, so here is a short comparison table:

Name ls man page No Trackers/Ads Clickable Headings Links² ToC¹ Local Search Noteworthy
Arch manual pages ls
You can’t perform that action at this time.