Skip to content

Instantly share code, notes, and snippets.

@mimansajaiswal
mimansajaiswal / LA1-zoplicate-add-force-merge.md
Last active January 10, 2025 23:54
Attempting to make add option also be able to ignore item type in zoplicate

Note

mimansajaiswal: how does the hook based duplicate detection work before adding something?

GitHub Copilot: Based on the code shown, here's how the hook-based duplicate detection works:

  1. The core detection logic appears to work through several hooks and processes:

Event Flow

  1. First, the detection starts in hooks.ts through the onNotify handler which listens for item modifications:
@mimansajaiswal
mimansajaiswal / A1a-zotero-cleanup-goal.md
Created January 10, 2025 23:49
Zotero Cleanup Scripts

Unfortunately, I didn't start using Zotero from the beginning.

I initially used Mendeley, then switched to Paperpile, and later moved to Notion. While I really liked Notion, it created a separate page for every entry - pages I never used, which was bothersome even though they could be ignored. Finally, I switched to Zotero.

However, Zotero lacks a built-in duplicate manager, and I often don't care about the item type of duplicates - I just want a single entry. I prefer conference papers or journal articles over preprints, and preprints over websites, as I sometimes save open review websites. Unfortunately, Zotero doesn't have this preference built-in, doesn't always show duplicate items, and won't merge fuzzily different items.

While there's a duplicate extension for Zotero (Zoplicate), it doesn't handle fuzzy matching well. Another major issue is that if you

@mimansajaiswal
mimansajaiswal / A1-claude-artifact-llm-chat-to-md.md
Last active January 23, 2025 22:21
Creating a tiny web app that formats md exports from github copilot, chat gpt and claude to the markdown format I want

Note

mimansajaiswal: write me a small app that takes in text like this:

"mimansajaiswal: write notation-fold.ts similar to notion-highlight.ts where if a region is marked to be collapsed, it allows you to collapse it and expand it similar to code folding in ides. this is how it works with multiple lines in code highlight: Use [!code highlight] to highlight a line. ts console.log('Not highlighted') console.log('Highlighted') // [!code highlight] console.log('Not highlighted') Renders (with custom CSS rules): console.log('Not highlighted') console.log('Highlighted') console.log('Not highlighted') // [!code highlight] outputs: The outer

 tag is modified: 
 You can also highlight multiple lines with a single comment: ts // [!code highlight:3] console.log('Highlighted') console.log('Highlighted') console.log('Not highlighted') Renders: console.log('Highlighted') console.log('Highlighted') console.log('Not highlighted')"

and a

@mimansajaiswal
mimansajaiswal / LA1-zoplicate-bulk-force-merge-context-ghc35s.md
Last active January 10, 2025 23:55
Attempting to modify zoplicate plugin to support force merge where item type of master is used

Note

mimansajaiswal: how are duplicates identified?

GitHub Copilot: Based on the code, duplicates seem to be identified through multiple methods and components. Here's the analysis:

  1. Primary identification is done by Zotero's built-in duplicate detection system through the duplicates pane.

  2. In bulkDuplicates.ts, duplicates are fetched using a fetchDuplicates() helper function that returns:

{