A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
- Headers
- Links
- Bold
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
The regex patterns in this gist are intended only to match web URLs -- http, | |
https, and naked domains like "example.com". For a pattern that attempts to | |
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
# Single-line version: | |
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s |
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
h1, h2, h3 { | |
line-height: 1.2; | |
} | |
body { | |
margin: 40px auto; | |
max-width: 650px; |
Pop open "filter preferences" in adblock plus, and add the following rules to hide mentions from people who don't follow you (and who you don't follow).
For the interactions/notifications page:
twitter.com##.interaction-page [data-follows-you="false"][data-you-follow="false"]:not(.my-tweet)
For the mentions page:
twitter.com##.mentions-page [data-follows-you="false"][data-you-follow="false"]:not(.my-tweet)
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
''' we're solving fizzbuzz with a little help from the web ''' | |
from html.parser import HTMLParser | |
from urllib.request import Request, urlopen | |
import re | |
import time | |
base_url = 'https://www.answers.com/Q/' | |
tag_name = 'div' | |
class_name = 'answer-body' | |
delimiter = '_' |
/* indicate media without a description | |
initial code by Paul (https://linernotes.club/@balrogboogie), expanded upon by FiXato (https://contact.fixato.org) | |
related discussions: https://dragonscave.space/@Mayana/106443499687608116. | |
Feel free to reuse it; it's public domain (https://linernotes.club/@balrogboogie/106681622019395866) */ | |
.media-gallery__item-thumbnail img:not([alt]), | |
.audio-player__canvas:not([title]), | |
.video-player video:not([title]), | |
.media-gallery__gifv video:not([title]) | |
{ | |
border: 1px dashed rgba(255, 0, 0, 0.5); |
# Go to uBlock's options and paste in the following under the "My Filters" tab | |
https://abs.twimg.com/fonts/chirp-bold-web.woff | |
https://abs.twimg.com/fonts/chirp-heavy-web.woff | |
https://abs.twimg.com/fonts/chirp-regular-web.woff | |
https://abs.twimg.com/fonts/v2/chirp-bold-web.woff | |
https://abs.twimg.com/fonts/v2/chirp-heavy-web.woff | |
https://abs.twimg.com/fonts/v2/chirp-medium-web.woff | |
https://abs.twimg.com/fonts/v2/chirp-regular-web.woff |
# -------------------------------------------------------------------- | |
# Recursively find pdfs from the directory given as the first argument, | |
# otherwise search the current directory. | |
# Use exiftool and qpdf (both must be installed and locatable on $PATH) | |
# to strip all top-level metadata from PDFs. | |
# | |
# Note - This only removes file-level metadata, not any metadata | |
# in embedded images, etc. | |
# | |
# Code is provided as-is, I take no responsibility for its use, |