This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const SELECTOR = '#main' | |
| const currentContainer = document.querySelector(SELECTOR) | |
| const upgradeLinks = links => { | |
| for (let i = 0; i < links.length; i++) { | |
| links[i].addEventListener('click', event => { | |
| event.preventDefault() | |
| const url = this.href | |
| const scroll = 0 | |
| history.replaceState({scroll: window.pageYOffset}, null, window.location.href) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| see https://github.com/kevinmarks/cassis-autolink-py/blob/master/cassis.py | |
| by Tantek Çelik, Kevin Marks, Kyle Mahan | |
| http://creativecommons.org/licenses/by-sa/3.0/ | |
| """ | |
| import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| def autotag(match): | |
| tag = match.groups()[0] | |
| return f"<a href=https://jamesg.blog/tag/{tag}>{tag}</a>" | |
| def autopersontag(match): | |
| person = match.groups()[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| import mf | |
| def summarize_github_profile(user): | |
| name = mf.get(f"https://github.com/{user}").card["name"] | |
| return f"GitHub profile for {name}" | |
| url_summary_templates = [ | |
| ( | |
| r"https://github.com/(?P<user>\w+)/(?P<project>[\w-]+)/pulls/(?P<pull>\d+)", |