Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gabalese
gabalese / annot2html.py
Last active December 16, 2015 20:19
Brain-dead simple utility to dump a HTML list out of a Sony Reader annot. db. (Made on a Mac, so it look for a /Volumes/READER mount. I'm way too lazy to amend that to accept a path argv[n])
#! /usr/bin/env python
# Brain-dead simple utility to dump a list of annotations from a Sony Reader .db
# Usage: $ python annot2html.py [int number of annot to fetch]
import sys
import sqlite3 as sql
import xml.etree.ElementTree as ET
# Mac-path!
file_db = sql.connect('/Volumes/READER/Sony_Reader/database/books.db')
@Acuf5928
Acuf5928 / Main.py
Last active August 16, 2017 13:32
# -*- coding: utf-8 -*-
# NOTE: richiede intallazione di jinja via pip install jinja2
# NOTE: testato su
import urllib.request
import csv
from datetime import datetime
from jinja2 import Template
import io
def cazzillo_text_parser(cazzillotext):

Run Jupyterlab on docker

Build starting from a Jupyter 2.x image.

Build

docker build -t jupyterlab .
@alanocallaghan
alanocallaghan / export-references.sh
Created March 23, 2022 15:17
Exporting references from a central to local bib file
## using natbib
## when finished adding refs, run
bibexport --nosave -o [LOCAL_BIB_FILE] main.aux
## then switch the \bibliography command from the central file to the local one, ie change
# % \bibliography{[CENTRAL_BIB_FILE]}
# % \bibliography{[LOCAL_BIB_FILE]}
# % with biblatex you would run something like
jabref -n --aux main.aux,[LOCAL_BIB_FILE] [CENTRAL_BIB_FILE]
## and again switch which bib file you're working with
@kidpixo
kidpixo / link_to_tmp.sh
Last active June 28, 2022 20:07
quickly symlink current directory to /tmp/
#!/usr/bin/python
# https://timwise.co.uk/2014/02/03/converting-kml-to-gpx-with-python/
# https://gist.github.com/timabell/8791116
import argparse
import xml.sax
parser = argparse.ArgumentParser(description='Convert annoying google android my tracks kml data to sensible gpx files')
parser.add_argument('input_file')
@vjt
vjt / copy-from-time-machine.sh
Last active March 8, 2024 17:05
Copy data from a Time Machine volume mounted on a Linux box.
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh