This file contains 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
from aqt import mw | |
from aqt.reviewer import Reviewer | |
class TagTogglerReviewer(Reviewer): | |
# Keep Python from complaining that self.shortcuts doesn't exist. | |
shortcuts = [] | |
def __init__(self, mw): | |
super().__init__(mw) |
This file contains 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
#!/bin/bash | |
# Retry a command with exponential backoff | |
function retry { | |
local maxAttempts=$1 | |
local secondsDelay=1 | |
local attemptCount=1 | |
local output= | |
shift 1 |
This file contains 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
# encoding=utf-8 | |
from bs4 import BeautifulSoup | |
import requests | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') | |
soup = BeautifulSoup(requests.get("http://kaomoji.n-at.me/kaomoji.html").text, "html.parser") | |
kaomojis = filter(None, ['かおもじ\t'+i.getText()+'\t顔文字' if '\n' not in i.getText() else None for i in soup.find_all('span', class_='kaomoji')]) |