Skip to content

Instantly share code, notes, and snippets.

View jhuet's full-sized avatar

Jérémy Huet jhuet

View GitHub Profile
@tuupola
tuupola / index.php
Last active March 4, 2019 09:47
Use JWT Authentication middleware with ZF Expressive
<?php
use Zend\Expressive\AppFactory;
use Firebase\JWT\JWT;
use Slim\Middleware\JwtAuthentication;
chdir(dirname(__DIR__));
require "vendor/autoload.php";
$app = AppFactory::create();
@dropmeaword
dropmeaword / kobo-export.sh
Created January 22, 2013 20:04
Export annotations from Kobo Touch ereader (assumes /media/KOBOeReader as the mountpoint)
#!/bin/sh
# ----------------------------------------------------------------------
# Extract the bookmark annotations from the Kobo database.
# ----------------------------------------------------------------------
kobodir=/media/KOBOeReader
db="$kobodir/.kobo/KoboReader.sqlite"
sqlite3 "$db" 'select VolumeID,StartContainerPath,Text,Annotation from Bookmark;' |
awk -F'|' 'BEGIN{OFS="|"}{gsub("/", "_", $1); print}' |
sort -t/ -k1 -k2 -n -k4 -k5 -k6 -k7 -k8 |
sed ' s/[^|]*|// s/[^|]*|// s/|/\n\n/ s/$/\n\n/ '