Skip to content

Instantly share code, notes, and snippets.

@rguliev
rguliev / field.html
Created August 3, 2017 12:58
django-uni-form + Twitter Bootstrap
{% if field.is_hidden %}
{{ field }}
{% else %}
<div class="control-group {% if field.errors %}error{% endif %}">
<label for="{{ field.auto_id }}" {% if field.field.required %}class="control-label"{% endif %}>
{% if field.field.required %}<b>{% endif %}{{ field.label|safe }}{% if field.field.required %}*</b>{% endif %}
</label>
<div class="controls">
{{ field }}
{% if field.errors %}
stat_smooth_func <- function(mapping = NULL, data = NULL,
geom = "smooth", position = "identity",
...,
method = "auto",
formula = y ~ x,
se = TRUE,
n = 80,
span = 0.75,
fullrange = FALSE,
level = 0.95,
@rguliev
rguliev / convert_pdf.py
Last active March 25, 2024 21:12 — forked from terencezl/convert_pdf.py
Python 3: pdfminer code to convert pdf to text, html or xml
# Use `pip3 install pdfminer.six` for python3
from typing import Container
from io import BytesIO
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter, XMLConverter, HTMLConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage