Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Martin Kubát dingosaurus

🏠
Working from home
  • COEX CZ, Freelancer
  • Plzeň, Praha
View GitHub Profile
@dingosaurus
dingosaurus / rl.py
Created Apr 15, 2019
reportlab font
View rl.py
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
FONT = os.path.join(settings.PROJECT_PATH, 'path/to/verah.ttf')
FONT_BOLD = os.path.join(settings.PROJECT_PATH, 'path/to/verahb.ttf')
FONT_NAME = "ticket_font"
FONT_BOLD_NAME = "ticket_font_bold"
FONT_FAMILY = "ticket_font_family"
@dingosaurus
dingosaurus / Europoslanci
Created Mar 21, 2019
Europoslanci - kontakty
View Europoslanci
// k 21.3.2019, nejsou zde zastupci KSČM
Dita Charanzová <dita.charanzova@europarl.europa.eu>
Martina Dlabajová <martina.dlabajova@europarl.europa.eu>
Olga Sehnalová <olga.sehnalova@europarl.europa.eu>
Michaela Šojdrová <michaela.sojdrova@europarl.europa.eu>
Petr Ježek <petr.jezek@europarl.europa.eu>
Jan Keller <jan.keller@europarl.europa.eu>
Luděk Niedermayer <ludek.niedermayer@europarl.europa.eu>
View matrix.py
import pprint
m = [(0, 0, 0, 0, 0),
(0, 0, 0, 0, 0),
(0, 0, 0, 0, 0),
(-1, 0, 0, 0, 0),
(-1, -1, 0, 0, 0),]
_x = len(m[0])
_y = len(m)
View gist:66d648c34a1083aee814c1fd13382c12
the_expressions = list()
for param in request.GET:
# priprava Q
the_expressions.append(Q(a=1, b=2, c=3))
objects = objects.filter(*the_expressions)