Skip to content

Instantly share code, notes, and snippets.

@philippmayrth
philippmayrth / markdown_to_bbcode.py
Last active June 1, 2019 20:37 — forked from sma/markdown_to_bbcode.py
Converts a subset of markdown into BBcode
import re
def markdown_to_bbcode(s):
links = {}
codes = []
def gather_link(m):
links[m.group(1)]=m.group(2); return ""
def replace_link(m):
return "[url=%s]%s[/url]" % (links[m.group(2) or m.group(1)], m.group(1))
def gather_code(m):
import os
import datetime
import subprocess
FailToBanLog = "/var/log/"
# line format is
# 1995-01-01 00:00:00,000 fail2ban.server [1142]: INFO rollover performed on /var/log/fail2ban.log
# 1995-01-01 00:00:00,000 fail2ban.actions [1142]: NOTICE [sshd] Ban XXX.XX.XXX.XX
@philippmayrth
philippmayrth / itunes-podcast-categories.yml
Created August 8, 2016 08:24 — forked from codeincontext/itunes-podcast-categories.yml
A list of the current iTunes podcast categories - in YAML format
- Arts:
- Design
- Fashion & Beauty
- Food
- Literature
- Performing Arts
- Spoken Word
- Visual Arts
- Business:
- Business News
on run argv
set aUrl to item 1 of argv
set aDelay to 5 #item 3 of argv
tell application "Safari"
set URL of document 1 to aUrl
delay aDelay # wait for the site to load
set html to source of document 1