Skip to content

Instantly share code, notes, and snippets.

View allhailwesttexas's full-sized avatar
🍔
🍜🍛🌮🍡🍕🍡🍺🍕🍢🍪🍣

Peter Stensmyr allhailwesttexas

🍔
🍜🍛🌮🍡🍕🍡🍺🍕🍢🍪🍣
View GitHub Profile
#! /usr/bin/env python
import subprocess
from datetime import datetime
from dateutil import parser
import os.path as op
import pytz
FORMATTER_ADOPTION_DATE = pytz.UTC.localize(datetime(2018, 7, 1))
@allhailwesttexas
allhailwesttexas / pagination_macros.html
Last active October 27, 2022 03:07
Flask/Jinja2 macro for rendering pagination in a template with Bootstrap components. Can center the component by wrapping in <nav class="text-center">.
{% macro render_pagination(pagination, endpoint) %}
<ul class="pagination">
{% if pagination.has_prev %}
<li>
<a href="{{ url_for(endpoint, page=pagination.prev_num) }}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>