Skip to content

Instantly share code, notes, and snippets.

View gregdl's full-sized avatar

mutedial gregdl

  • tokyo
View GitHub Profile
@chr15m
chr15m / aider-convention-scraper
Last active April 18, 2025 14:40
Convert documentation URLs to Markdown "convention" files to be used by aider and other LLMs
#!/bin/sh
# Scrapes documentation from a URL and converts it to Markdown suitable for aider convention files
# to provide context to the LLM.
if [ $# -eq 0 ]; then
echo "Usage: $(basename "$0") <URL> [URL...]"
echo
echo "Generate aider 'convention' Markdown context from documentation URLs."
echo "suitable for providing LLM context about a project's conventions and style."
@FeralFlora
FeralFlora / 01 Zotero Integration import template and more!.md
Last active April 16, 2025 06:55
Zotero import template for the Zotero integration plugin for Obsidian. Screenshots and usage guide over in the Obsidian forum here: https://forum.obsidian.md/t/zotero-integration-import-templates/36310/105?u=feralflora
  • ZI-main.md
    • The main Zotero Integration template
  • runImport.md
    • Template that enables updating literature notes at the click of a button, and much more.
  • Meta bind button template
    • Template for in-note button that executes runImport.md
@QWxleA
QWxleA / Readme.md
Last active April 4, 2025 01:53
Obsidian zotero template for use with "obsidian-zotero-integration" plugin

QWxlea's over-engineered zotero template

Faq

What are these %% begin id-pn2xitti%% and %% end id-pn2xitti %% and ^pn2xitti? These are the persistance-markers of the indivual highlights, and the reference-id to that highlight.

The markers are meant for the importer. It will skip all text within those markers, so they stay when updating a zotero-import. Removing a marked block does not work well, it will not be reimported. Don't know how to fix that. If you want to reimport a highlight-block, best is to change the highlight in zotero (for example change the color). This will update the id, and on the next import the new highlight will be imported.

The reference-id is used like this: [[@name-of-the-note#^pn2xitti]]

@lctrt
lctrt / sketch.lua
Created May 8, 2020 14:20
MS18S Sequencer - forked for JF usage
--- m185 ~ 2-voice sequencer inspired by RYK M-185
-- forked from https://github.com/jlmitch5/m18s
-- in 1: clock
-- output on channel 1 and 2 from JF
function shouldGateFire (stage, numStages, gateMode)
if stage <= numStages then
if gateMode == "all" or (gateMode == "single" and stage == 1) or
(gateMode == "every2" and (stage + 1) % 2 == 0) or
(gateMode == "every3" and (stage + 2) % 3 == 0) or
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 9, 2025 14:04
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aparrish
aparrish / data-as-documents.ipynb
Last active October 23, 2020 10:32
"Documents as data" notebook. (Python 2.7) Click the "Raw" button to download! Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aparrish
aparrish / word_counts_with_counter.ipynb
Last active October 23, 2020 10:33
Quick word counts with Counter. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@quadrismegistus
quadrismegistus / gensim_word2vec_make_semantic_network.py
Last active June 7, 2020 15:14
Code to make a network out of the shortest N cosine-distances (or, equivalently, the strongest N associations) between a set of words in a gensim word2vec model.
"""
Code to make a network out of the shortest N cosine-distances (or, equivalently, the strongest N associations)
between a set of words in a gensim word2vec model.
To use:
Set the filenames for the word2vec model.
Set `my_words` to be a list of your own choosing.
Set `num_top_dists` to be a number or a factor of the length of `my_words.`
Choose between the two methods below to produce distances, and comment-out the other one.
"""
@quadrismegistus
quadrismegistus / gensim_word2vec_procrustes_align.py
Last active November 16, 2023 01:57
Code for aligning two gensim word2vec models using Procrustes matrix alignment. Code ported from HistWords <https://github.com/williamleif/histwords> by William Hamilton <[email protected]>. [NOTE: This code is DEPRECATED for latest versions of gensim. Please see instead this updated version of the code <https://gist.github.com/zhicongchen/9e23…
def smart_procrustes_align_gensim(base_embed, other_embed, words=None):
"""Procrustes align two gensim word2vec models (to allow for comparison between same word across models).
Code ported from HistWords <https://github.com/williamleif/histwords> by William Hamilton <[email protected]>.
(With help from William. Thank you!)
First, intersect the vocabularies (see `intersection_align_gensim` documentation).
Then do the alignment on the other_embed model.
Replace the other_embed model's syn0 and syn0norm numpy matrices with the aligned version.
Return other_embed.
@jabranham
jabranham / evernote-to-org-mode.org
Last active October 24, 2023 13:52
Evernote to org-mode

Export from evernote

You’ll have to open up the evernote application on either Mac or Windows (they don’t have a linux client), right click on the notebook you want to export, and select “Export.” Select the option to export to html (either one page or several pages, depending on your preference. I went with one html page for each note).

Clean filenames