You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried all the "flashcards" apps.
Nothing has stuck with me.
This is my final attemp which seems to finally work (for now :D).
I just take screenshots of things I find interesting, move them to "flashcards" folder (using Keyboard maestro macro), and use Scriptkit to "spaced-repeat" them.
// Name: Flashcards// Description: Spaced-repeat images, managed just by filesystem// Shortcut: shift+ctrl+option+cmd+oimport'@johnlindquist/kit'constflashcardsDir=kenvPath('db','flashcards')awaitensureDir(flashcardsDir)consttoday=newDate()letfiles=awaitreaddir(flashcardsDir)letrenamed=0for(constfileoffiles){if(!file.endsWith('.png'))continueconstparsed=parseFilename(file)if(!parsed){renamed++constmax=currentMaxForDate(formatDate(today))constnewName=formatFilename(formatDate(today),max+1,0)awaitrename(path.join(flashcardsDir,file),path.join(flashcardsDir,newName))}}if(renamed>0){notify(`Flashcards: Renamed ${renamed} files to match the flashcard format`)files=awaitreaddir(flashcardsDir)// refresh files after rename}letcards=files.filter(file=>file.endsWith('.png')).map(file=>{constparsed=parseFilename(file)!return{filename: file,
...parsed,fullPath: path.join(flashcardsDir,file),}})if(cards.length===0){open(`file://${flashcardsDir}`)awaitdiv(md(`## No flashcards found in ${flashcardsDir}Just add images (must be pngs!) there (I've opened the folder for you).Don't worry about the filename, it will be renamed automatically on the next run.After you are done, just rerun this script `))exit()}cards.sort((a,b)=>{if(a.nextReviewDate<formatDate(today)&&b.nextReviewDate>=formatDate(today))return-1if(a.nextReviewDate>=formatDate(today)&&b.nextReviewDate<formatDate(today))return1returna.orderInBucket-b.orderInBucket})constreviewDays=[1,2,4,7,14,30]constshortcuts={"remember": 'r',"forgot": 'f',"delete": 'd',}constcardsToReview=cards.filter(card=>{constreviewDate=newDate(card.nextReviewDate)returnreviewDate<=today})const{ size }=awaitgetActiveScreen()for(constcardofcardsToReview){constdays=reviewDays[Math.min(card.numberOfReviewsDone,reviewDays.length-1)]constnextReview=newDate()nextReview.setDate(today.getDate()+days)awaitdiv({x: 50,y: 50,height: size.height-100,width: size.width-100,enter: "Close",hint: `${cardsToReview.length} cards to review`,html: `<img src="file://${card.fullPath}" style="width: 100%; height: 100%; object-fit: contain" />`,className: "h-full w-full",// Otherwise the image could grow too much and cause y scrollshortcuts: [// Right bar{name: "Remember",key: "Space",bar: "right",onPress: async()=>{constnewFilename=formatFilename(formatDate(nextReview),card.orderInBucket,card.numberOfReviewsDone+1)awaitrename(card.fullPath,path.join(flashcardsDir,newFilename))submit(null)},},// Left bar{name: "Forgot",key: shortcuts.forgot,bar: "left",onPress: async()=>{constlastCard=cards.reduce((max,card)=>Math.max(max,card.orderInBucket),0)constnewFilename=formatFilename(formatDate(today),lastCard+1,0)awaitrename(card.fullPath,path.join(flashcardsDir,newFilename))submit(null)},},{name: "Delete",key: shortcuts.delete,bar: "left",onPress: async()=>{awaittrash(card.fullPath)submit(null)},},{name: "Reveal in Finder",key: "r",bar: "left",onPress: async()=>{// -R reveals the file in Finder instead of opening itawaitexec(`open -R "${card.fullPath}"`)},},],})}say(`Time flows like water,Knowledge grows with each review,Mind blooms day by day`)awaitdiv(md(`# That's all folks!All flashcards have been reviewed.See ya next time! `))// Helpers// ===functionparseFilename(filename: string){constmatch=filename.match(/^CARD_(\d{4}-\d{2}-\d{2})_(\d+)_(\d+)\.png$/)if(!match)returnnullreturn{nextReviewDate: match[1],orderInBucket: parseInt(match[2],10),numberOfReviewsDone: parseInt(match[3],10),}}functionformatFilename(nextReviewDate: string,orderInBucket: number,numberOfReviewsDone: number){return`CARD_${nextReviewDate}_${orderInBucket}_${numberOfReviewsDone}.png`}functioncurrentMaxForDate(date: string){constfiles=readdirSync(flashcardsDir)returnfiles.filter(file=>file.startsWith(`CARD_${date}_`)).map(file=>parseFilename(file)!.orderInBucket).reduce((max,order)=>Math.max(max,order),0)}functionformatDate(date: Date){returndate.toISOString().slice(0,10)}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have tried all the "flashcards" apps.
Nothing has stuck with me.
This is my final attemp which seems to finally work (for now :D).
I just take screenshots of things I find interesting, move them to "flashcards" folder (using Keyboard maestro macro), and use Scriptkit to "spaced-repeat" them.
Screenshot-2025-02-09T19.35.35-converted.mov
Open flashcards in Script Kit
Beta Was this translation helpful? Give feedback.
All reactions