Skip to content

Instantly share code, notes, and snippets.

@eshapard
eshapard / filterSafety.py
Last active October 23, 2023 21:04
Anki 2.0 addon. Prevents learning (and re-learning) cards from being removed from a filtered deck. This allows you to rebuild the deck while keeping the learning cards inside of it; bypassing the problems with Anki decks where learning cards are set back to 'new' or 'review' when they exit a filtered deck.
# Filter Safety
# Anki 2.0 addon
# Author EJS
# https://eshapard.github.io/
#
# Prevents cards in learning state from being moved out of a filtered deck
# when you rebuild it.
from anki.sched import Scheduler
#from aqt.utils import showInfo
@Samathy
Samathy / dumppdfcomments.py
Created January 5, 2018 18:50
Python Script to extract highlighted text from PDFs. Uses python-poppler-qt4. Updated [1] to Python 3 [1] https://stackoverflow.com/questions/21050551/extracting-text-from-higlighted-text-using-poppler-qt4-python-poppler-qt4
import popplerqt4
import sys
import PyQt4
def main():
doc = popplerqt4.Poppler.Document.load(sys.argv[1])
total_annotations = 0
for i in range(doc.numPages()):