Skip to content

Instantly share code, notes, and snippets.

@pauldowman
pauldowman / export-kobo-highlights.sh
Created September 17, 2021 22:22
Kobo highlight exporter script
#!/bin/bash
KOBO_ROOT="$1" # The root of the mounted Kobo volume
HIGHLIGHTS_FILE="$2" # The output
sqlite3 "$KOBO_ROOT/.kobo/KoboReader.sqlite" << ENDSQL
.mode csv
.output $HIGHLIGHTS_FILE
.print "Title,Author,Date,Highlight"
select content.Title, content.Attribution, Bookmark.DateCreated, Bookmark.Text from Bookmark left join content on Bookmark.VolumeID = content.ContentID where Text is not null;
@pauldowman
pauldowman / .gitconfig
Created March 20, 2013 03:35
Some useful git config settings. Save in the file named ".gitconfig" in your home directory.
[color]
diff = auto
status = auto
branch = auto
sh = auto
ui = true
wtf = auto
[color "branch"]
current = green reverse
local = green
@pauldowman
pauldowman / gist:5145517
Created March 12, 2013 18:27
Examples from today's class (class vs instance variables, initializers)
# Basic class with one attribute ("name")
class Person
attr_accessor :name
# line 2 is equivalent to lines 5 to 11:
# def name=(something)
# @name = something
# end
#
# def name
@pauldowman
pauldowman / github-commits-listing
Created June 13, 2012 17:13
Script to open a browser with the github commit listing for the current repo & branch
#!/bin/bash
BRANCH=`git branch | grep '^\*' | awk '{print $2}'`
REPO=`git remote -v | grep origin | head -1 | sed 's/[^:]*:\([^\.]*\).*/\1/'`
open "https://github.com/$REPO/commits/$BRANCH"
➜ cucumber --i18n en-lol
| feature | "OH HAI" |
| background | "B4" |
| scenario | "MISHUN" |
| scenario_outline | "MISHUN SRSLY" |
| examples | "EXAMPLZ" |
| given | "* ", "I CAN HAZ " |
| when | "* ", "WEN " |
| then | "* ", "DEN " |
| and | "* ", "AN " |