Spaced repetition
sm2.pySM-2, the scheduler Anki was built on, decides when each snippet comes back: soon after a miss, further out each time you remember it.
Save code snippets as you learn. CodePulse schedules your reviews with the SM-2 algorithm, so you actually remember them.
You do the saving and the rating. Working out when to review is the algorithm's job.
Paste the code and a line on what you learned. The language is detected as you paste.
SM-2 picks the day each snippet comes back, and a daily email tells you when reviews are due.
Rate each card Forgot, Hard or Easy. Forgot brings it back tomorrow; Easy pushes it further out each time.
Ebbinghaus measured it in 1885: without review, memory drops off a cliff within a day and settles near a fifth. CodePulse queues a new snippet for the day you save it, then brings it back after 4, 6, 16 and 45 days while you keep rating it Easy. Each review flattens the curve.
Illustrative decay, real review days. Drag across the chart to read any day.
SM-2, the scheduler Anki was built on, decides when each snippet comes back: soon after a miss, further out each time you remember it.
Results are ranked by how much they share with your query, not by whether one keyword matches.
Edit distance catches a snippet you already saved, even when the variable names changed.
k-means groups related snippets into clusters. No manual tagging.
Draft a thread from any topic cluster, edit each point, then copy it out.
Eight algorithms in plain Python: no scikit-learn, no NLTK, no numpy, no pre-trained models. Pick one to read the code that runs it.
1,144 lines · Python standard library only
def sm2_schedule(
quality: int,
repetitions: int,
ease_factor: float,
interval: int,
) -> tuple[int, int, float]:
# …
if quality < 3:
# Forgot — reset progress
new_repetitions = 0
new_interval = 1
else:
# Remembered — advance schedule
new_repetitions = repetitions + 1
if repetitions == 0:
# Quality-adjusted first interval: Easy gets 4 days, Hard gets 2 days.
# Standard SM-2 fixes this at 1, but that makes every first review
# feel identical regardless of confidence — poor UX.
new_interval = 4 if quality >= 4 else 2
elif repetitions == 1:
new_interval = 6
else:
new_interval = round(interval * ease_factor)
# Adjust ease factor based on quality (applies regardless of pass/fail)
new_ease_factor = ease_factor + (0.1 - (5 - quality) * (0.08 + (5 - quality) * 0.02))
new_ease_factor = max(1.3, round(new_ease_factor, 4))
return new_interval, new_repetitions, new_ease_factorI kept re-Googling the same things: the flex trick for centering a div, the cleanup in a useEffect, the git command that undoes the last commit. I had learned each one, more than once.
So I built the tool I wanted. Save the snippet once, and let the schedule bring it back right before it slips. I wrote every algorithm behind it from scratch, so I can explain every number it shows you.
Pritha · built CodePulse as a final-year project
Unless you review it tomorrow. CodePulse makes sure you do.
Free forever for students. No credit card. No nonsense.