Skip to content

Instantly share code, notes, and snippets.

@John07
John07 / to_csv.xsl
Created April 28, 2011 11:27
Convert Pentabarf schedule.xml to csv
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" indent="no" encoding="utf-8" />
<xsl:template match='text()|@*' />
<xsl:template match="event">
FOSSGIS2011-<xsl:value-of select="@id" />-<xsl:value-of select="normalize-space(language)" /><xsl:if test="not(normalize-space(language))">de</xsl:if>-<xsl:value-of select="slug" />;<xsl:value-of select="title" />;<xsl:for-each select="persons/person"><xsl:value-of select="." /><xsl:text> </xsl:text></xsl:for-each>; <xsl:value-of select="../../@date" /><xsl:text> </xsl:text><xsl:value-of select="start" />;<xsl:value-of select="room" />
</xsl:template>
@John07
John07 / lightroom-exporting.sql
Last active August 29, 2015 14:04
An incomplete collection of ugly sqlite commands to export metadata from a Lightroom catalog. You can export Lightroom keywords, color labels, collections and more depending on your sqlite skills. Only tested with a Lightroom 2 catalog! (Note that this is not a complete script but rather a collection of commands that may need to be modified to run)
sqlite3 backup-catalog.lrcat
.output export.txt
-- get all keywords with their id
SELECT id_local, name FROM AgLibraryKeyword;
-- get list of all files with keyword id 88890
SELECT stackParent_fileName, stackParent____colorLabels, rating FROM Adobe_images AS a JOIN AgLibraryKeywordImage AS b WHERE b.tag=88890 AND a.id_local=b.image;
-- get list of all files for keyword Bob
@John07
John07 / open_wunderlist_tasks.sh
Last active August 29, 2015 14:00
Count the number of open tasks in Wunderlist 2
# counts the number of open tasks in Wunderlist across all lists
# (pretty sure there's a more elegant way of doing this but works for now)
sqlite3 "/Users/USERNAME/Library/Containers/com.wunderkinder.wunderlistdesktop/Data/Library/Application Support/Wunderlist/WKModel.sqlite" "select ZTITLE from ZRESOURCE where ZOWNER1 is not 1 and ZPARENTTASK is null and ZCOMPLETEDAT is null" | wc -l