Skip to content

Instantly share code, notes, and snippets.

View ianand's full-sized avatar

Ishan Anand ianand

View GitHub Profile
@ianand
ianand / Selected HTML to Markdown
Created November 20, 2025 20:46
Bookmarklet to export selected text from chatgpt into Markdown (handles headings, ol, li, and code blocks)
javascript:(function()%7B(() %3D> %7B%0A const sel %3D window.getSelection()%3B%0A if (!sel %7C%7C sel.rangeCount %3D%3D%3D 0) %7B%0A console.warn("No selection found. Select some text on the page first.")%3B%0A return%3B%0A %7D%0A%0A const range %3D sel.getRangeAt(0)%3B%0A const container %3D document.createElement("div")%3B%0A container.appendChild(range.cloneContents())%3B%0A%0A const selectedHtml %3D container.innerHTML%3B%0A%0A %2F%2F ---- HTML → Markdown converter ----%0A%0A function convertNode(node%2C ctx %3D %7B listDepth%3A 0 %7D) %7B%0A if (node.nodeType %3D%3D%3D Node.TEXT_NODE) %7B%0A %2F%2F Collapse whitespace a bit but keep words separated%0A return node.nodeValue.replace(%2F%5Cs%2B%2Fg%2C " ")%3B%0A %7D%0A%0A if (node.nodeType !%3D%3D Node.ELEMENT_NODE) return ""%3B%0A%0A const tag %3D node.tagName.toLowerCase()%3B%0A const content %3D () %3D> convertChildren(node%2C ctx).trim()%3B%0A%0A switch (tag) %7B%0A case "h1"%3A return "%5Cn%23 " %2B cont
@ianand
ianand / plot-embeddings-pca.ipynb
Last active February 1, 2025 06:58
plot-embeddings-pca.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ianand
ianand / running-gpt2-small.ipynb
Last active January 8, 2025 20:12
running-gpt2-small.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ianand
ianand / basic-svd-embeddings.ipynb
Last active October 7, 2024 04:35
basic-svd-embeddings.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ianand
ianand / Build.xcconfig
Created April 5, 2011 19:37
How to build Urban Airship on iOS/iPhone Simulator without warning messages
/*
Build.xcconfig
PushSample
UrbanAirship provides a simulator version of their library:
http://help.urbanairship.com/discussions/questions/441-running-apps-in-simulator-with-uaiap
Unfortunately including this library in your project will add a warning message during builds:
"file was built for archive which is not the architecture being linked (armv6)"