Mimsy Were the Borogoves

Hacks: Articles about programming in Python, Perl, Swift, BASIC, and whatever else I happen to feel like hacking at.

42 Astoundingly Useful Scripts and Automations for the Macintosh

Work faster and more reliably. Add actions to the services menu and the menu bar, create drag-and-drop apps to make your Macintosh play music, roll dice, and talk. Create ASCII art from photos. There’s a script for that in 42 Astounding Scripts for the Macintosh.

Use LIKE to find duplicate strings in SQLite

Jerry Stratton, April 16, 2010

I’ve been importing all of my separate blogs/page creators into a central Django CMS based off of SQLite. One issue has been that keywords are getting duplicated because SQLite is case sensitive.

LIKE is not case sensitive, however, so you can use that to find duplicate strings.

  • SELECT GROUP_CONCAT(key2.key, ', '), COUNT(key1.id)-1 AS duplicateCount FROM keywords key1 JOIN keywords key2 ON key1.key LIKE key2.key GROUP BY key1.id HAVING duplicateCount > 0;

The table is “keywords”, the column with the keyword’s name is “key”.

  1. <- Inkscape extension color-picker
  2. Inkscape getElementById ->