javascript

37 posts tagged “javascript”.

  1. 2025
  2. Creating a tiled zoomable image with OpenSeadragon and vips

    The San Francisco Microscopical Society has some extremely high resolution scanned images - one of them is a 1.67GB PNG file with a 25,088 × 17,283 pixel resolution.

    1 min read
  3. Finding the SQLite version used by Web SQL in Chrome

    Google Chrome still includes support for Web SQL, the long since abandoned proposed standard for shipping a SQL engine in browser JavaScript.

    1 min read
  4. Bundling Python inside an Electron app

    I used python-build-standalone for this, which provides a version of Python that is designed for easy of bundling - it's also used by PyOxidize.

    1 min read
  5. Embedding JavaScript in a Jupyter notebook

    I recently found out modern browsers include a JavaScript API for creating public/private keys for cryptography.

    1 min read
  6. axe-core and shot-scraper for accessibility audits

    I just watched a talk by Pamela Fox at North Bay Python on Automated accessibility audits. The video should be up within 24 hours.

    1 min read
  7. Minifying JavaScript with npx uglify-js

    While upgrading CodeMirror in Datasette I figured out how to minify JavaScript using on the command line without first installing any teels, using npx (which downloads and executes a CLI tool while…

    1 min read
  8. Manipulating query strings with URLSearchParams

    The class, in every modern browser since IE 11, provides a sensible API for manipulating query string parameters in JavaScript.

    1 min read
  9. Extracting web page content using Readability.js and shot-scraper

    Readability.js is "A standalone version of the readability library used for Firefox Reader View". I figured out how to use the two of these together to extract the core content from a web page using…

    1 min read
  10. How streaming LLM APIs work

    I decided to have a poke around and see if I could figure out how the HTTP streaming APIs from the various hosted LLM providers actually worked. Here are my notes so far.

    2 min read
  11. 2024
  12. Copy rich text to the clipboard

    I've been experimenting with a tool for generating the content for a weekly Substack newsletter by querying the Datasette API for my blog and assembling HTML for the last week of content.

    1 min read
  13. Using Jest without a package.json

    I wanted to try out Jest for writing JavaScript unit tests, in a project that wasn't set up with and other NPM related things. Jest looks for tests in a directory.

    1 min read
  14. Collecting replies to tweets using JavaScript

    I ran a survey on Twitter the other day to try and figure out what people mean when they use the term "agents" with respect to AI.

    1 min read
  15. Writing JavaScript that responds to media queries

    I needed to apply some changes to the DOM if the users window was smaller than 800px - or if the user resized their window to less than 800px after they had first loaded the page.

    1 min read
  16. Dynamically loading multiple assets with a callback

    For datasette-leaflet-geojson I wanted to dynamically load some external CSS and JavaScript and then execute some code once they had loaded (issue 14).

    1 min read
  17. Constant-time comparison of strings in Node

    When comparing secrets, passwords etc it's important to use a constant-time compare function to avoid timing attacks. In Python I use , documented here. I needed an equivalent in Node.js today.

    1 min read
  18. Attaching a generated file to a GitHub release using Actions

    For Datasette Desktop I wanted to run an action which, when I created a release, would build an asset for that release and then upload and attach it.

    1 min read
  19. GitHub Actions, Issues and Pages to build a daily planner

    I'm trying a new thing: a private daily planner, where each day I note down my goals for the day and make notes on my progress towards them as the day progresses.

    1 min read
  20. Working around the size limit for nodeValue in the DOM

    TIL that in the DOM has a size limit! I had a table cell element containing HTML-escaped JSON and I was doing this: This was breaking on larger JSON strings.

    1 min read
  21. Implementing a "copy to clipboard" button

    I had to figure this out while building datasette-copyable - demo here. The trick is to run to copy to the clipboard - but only after first ensuring that some selectable content (probably in a…

    1 min read
  22. Dropdown menu with details summary

    I added dropdown menus to Datasette 0.51 - see 1064. I implemented them using the HTML element. The HTML looked like this: See the top right corner of https://latest-with-plugins.datasette.io/ for a…

    1 min read