Skip to content

Instantly share code, notes, and snippets.

View z1lc's full-sized avatar
🗃️
reviewing flashcards

Rob Sanek z1lc

🗃️
reviewing flashcards
View GitHub Profile
import os
import re
from datetime import datetime, timedelta
from typing import Optional, List
import pytz
import requests
import sendgrid
from bs4 import BeautifulSoup
import json
for i in range(1, 100):
toPrint = ""
if i % 3 == 0:
toPrint += "Crackle"
if i % 5 == 0:
toPrint += "Pop"
if toPrint == "":
toPrint += str(i)
print(toPrint)
@z1lc
z1lc / genanki_testing.py
Created April 27, 2020 02:31
Genanki compatibility testing
import genanki
# models/notes based on genanki README
templates = [
{
'name': 'Card 1',
'qfmt': '{{Question}}',
'afmt': '{{FrontSide}}<hr id="answer">{{Answer}}',
@z1lc
z1lc / autodq.py
Created September 1, 2019 17:31
Automatically run Anki Data Quality checks & display results in main window
import re
from aqt import mw
from aqt.deckbrowser import DeckBrowser
from aqt.qt import *
import aqt.forms
from aqt.utils import showInfo
PREFIX = 'zAQ:'
@z1lc
z1lc / clozetablemanager.py
Last active August 2, 2019 03:40
Anki Add-on: allow cards in the Cloze Tables subdeck to not bury siblings
import random
from datetime import date, timedelta
from aqt import mw
from aqt.qt import *
from anki.hooks import addHook
from anki.utils import intTime
#card.queue: 0=new, -1=suspended
@z1lc
z1lc / force using correct shift.ahk
Created January 19, 2019 05:55
AutoHotkey script to force usage of the correct shift key
<+q::SoundPlay *-1
<+w::SoundPlay *-1
<+e::SoundPlay *-1
<+r::SoundPlay *-1
<+t::SoundPlay *-1
<+a::SoundPlay *-1
<+s::SoundPlay *-1
<+d::SoundPlay *-1
<+f::SoundPlay *-1
<+g::SoundPlay *-1
@z1lc
z1lc / anki_new_card_setter.py
Last active January 19, 2019 04:04
Anki Add-on: Set the number of new cards due in a specified deck based on how much time total you want to spend in review
import math
from aqt import mw
from aqt.qt import *
DECK_EXACT_NAME = "z"
TOTAL_MINUTES = 50
# TODO: I can get this stuff from existing information in DB
CARDS_PER_MINUTE = 11.5
REPS_PER_NEW_CARD = 2.5
@z1lc
z1lc / workflowy_toodledo_habits_and_tasks.py
Last active April 1, 2019 05:40
PyQt-based resizable split view of Workflowy and Toodledo Habits & Tasks
Moved to https://github.com/z1lc/core/tree/master/src/main/python/productivity
@z1lc
z1lc / nbaplayers.py
Created October 1, 2018 08:50
Use nba-players.herokuapp.com API to download all images for NBA players
import requests
def getTeam(team):
request = requests.get('https://nba-players.herokuapp.com/players-stats-teams/' + team)
if request.status_code == 200:
return request.json()
else:
raise Exception("Query failed to run by returning code of {}. {}".format(request.status_code))
def getImageName(playerName):
@z1lc
z1lc / heartRateComparison.r
Last active August 15, 2016 03:46
Fitbit Surge vs. Polar H7 + Nexus 6 + Strava: Comparing Heart Rate Sensors
library(XML)
library(dplyr)
library(lubridate)
library(reshape2)
library(ggplot2)
fitbit <- xmlToDataFrame(getNodeSet(xmlParse("fitbit.tcx"), "//ns:Trackpoint", "ns"),
stringsAsFactors = FALSE)
strava <- xmlToDataFrame(getNodeSet(xmlParse("strava.tcx"), "//ns:Trackpoint", "ns"),