Skip to content

Instantly share code, notes, and snippets.

@ziafazal
ziafazal / strip_html.py
Created October 2, 2019 10:06
utility method to strip html tags and entities
import re
from django.utils.html import strip_tags
def strip_html_tags(text, strip_entities=True):
"""
Args:
text (str): text having html tags
strip_entities (bool): If set to True html entities are also stripped
@ziafazal
ziafazal / install_sqlite_3.14.sh
Created September 8, 2016 14:28
install custom sqlite(3.14) with pysqlite
# install custom sqlite 3.14
wget https://github.com/ghaering/pysqlite/archive/2.8.3.tar.gz
wget https://www.sqlite.org/2016/sqlite-autoconf-3140100.tar.gz
tar -xzvf sqlite-autoconf-3140100.tar.gz
tar -xzvf 2.8.3.tar.gz
cp -av sqlite-autoconf-3140100/. pysqlite-2.8.3/
cd ./pysqlite-2.8.3 && python setup.py build_static install