Skip to content

Instantly share code, notes, and snippets.

@OmidS
OmidS / add_to_zshrc.sh
Created August 26, 2024 18:35 — forked from karpathy/add_to_zshrc.sh
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@OmidS
OmidS / edit-zotero-extra-field.js
Last active August 14, 2024 10:24
Removes some values from the Zotero extra field
// Original reference:
// https://github.com/eschnett/zotero-citationcounts/issues/2#issuecomment-765117249
// To run this, open Tools > Developer > Run JavaScript in Zotero, paste the JavaScript below and then press run.
// To make sure this code won't delete too much, by default it will just rehearse what will happen if you run it.
// Press cancel on any dialog to stop the rehearsal.
// If you are happy with the rehearsal, change 'rehearse' in the next line to 'false' and run again.
const rehearse = true; // Set this to false to actually make changes
const moveToTop = false; // Set this to true to move to top instead of deleting. This can help make "extra" sortable.