Skip to content

Instantly share code, notes, and snippets.

@jonahlyn
jonahlyn / strip_tags.py
Last active December 17, 2015 22:49 — forked from braveulysses/strip_tags.py
Updated for BeautifulSoup4
from bs4 import BeautifulSoup
def strip(untrusted_html):
"""Strips out all tags from untrusted_html, leaving only text.
Converts XML entities to Unicode characters. This is desirable because it
reduces the likelihood that a filter further down the text processing chain
will double-encode the XML entities."""
ssoup = BeautifulSoup(untrusted_html, "xml")
safe_html = ''.join(soup.findAll(text=True))
@jonahlyn
jonahlyn / bash-cheatsheet.sh
Last active December 2, 2019 18:28 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems #linux
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04