Skip to content

Instantly share code, notes, and snippets.

@maximebf
maximebf / gist:3986659
Created October 31, 2012 11:56
Jinja2 macro to render WTForms fields with Twitter Bootstrap
{% macro form_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = '' %}
{% if not with_label %}
{% set placeholder = field.label.text %}
{% endif %}
<div class="control-group {% if field.errors %}error{% endif %}">
{% if with_label %}
<label for="{{ field.id }}" class="control-label">
{{ field.label.text }}{% if field.flags.required %} *{% endif %}:
@darkuncle
darkuncle / The_Rules.md
Last active June 26, 2024 18:49
The Rules - guidelines learned through hard experience in operations

NEW! Fan of the list Diego Peinador has done what I've been too lazy to do for years: stand up an easily-remembered domain for The Rules, complete with one-per-page URL schema - e.g., for Rule 42 just visit https://the-rul.es/42/

Thanks Diego! <3

(subject to additions, but rarely changes)

rule 0: It has to work.

rule 1: As simple as possible.