Skip to content

Instantly share code, notes, and snippets.

View tvwerkhoven's full-sized avatar

Tim van Werkhoven tvwerkhoven

  • ASML
  • Netherlands
View GitHub Profile
@tvwerkhoven
tvwerkhoven / .gitignore
Created August 2, 2011 08:59
XeTeX cheatsheet
*.aux
*.log
*.out
*.pdf
*.synctex.gz*
@tvwerkhoven
tvwerkhoven / README
Created September 20, 2011 10:57
pyglyph -- identify unicode glyphs
pyglyph -- identify unicode glyphs
* About
pyglyph.py can be used to decode unicode strings and identify the glyphs.
This can be useful if you want to know what exact glyph was used somewhere,
simply copy it and use it as input for pyglyph.
Pyglyph works best with python2.7 (because of argparse), but is compatible
with earlier versions.
@tvwerkhoven
tvwerkhoven / README
Created November 6, 2011 22:29
iPhone 3GS battery life analysis & plots
These files can be used to analyse the battery usage of an iPhone 3GS under real-life usage.
iphone_battery.csv: measurement data
proc_iphone_batt.py: process & plot data
@tvwerkhoven
tvwerkhoven / mac-dict.py
Created December 20, 2011 17:09
look up phonetic spelling Apple's Dictionary.app through DictionaryServices
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
"""
@file mac-dict.py -- lookup entries in the Mac dictionary
@author Tim van Werkhoven
@date 20111220
@copyright Copyright (c) 2011 Tim van Werkhoven
Use DictionaryServices to look up words in Apple's Dictionary.app.
@tvwerkhoven
tvwerkhoven / coconut_plot.py
Last active December 10, 2015 01:58
Plot coconutBattery.app output
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@file coconut_plot.py -- plot Macbook battery data
@author Tim van Werkhoven
@date 20121223
@copyright Copyright (c) 2012 Tim van Werkhoven <timvanwerkhoven@gmail.com>
This scripts plots data exported from [CoconutBattery.app][1] as CSV. This
can be useful to graphically investigate your battery performance.
@tvwerkhoven
tvwerkhoven / battery_logger.sh
Last active April 6, 2022 02:56
Log Macbook battery status with system_profiler(8) and ioreg(8), see http://home.strw.leidenuniv.nl/~werkhoven/etc/battlog.html
#!/bin/bash
#
# About
# =====
#
# Log battery info from command-line with SYSTEM_PROFILER(8) and IOREG(8) to a
# user-configurable directory.
#
# Run with -h to see usage options.
#
@tvwerkhoven
tvwerkhoven / milieudata_januari.json
Last active December 10, 2015 13:48
Produce energy label for Albert Heijn recipes
{"Framboos": [["C", "Spanje"], ["E", "Mexico"]], "Nectarine": [["B", "Chili"]], "Limoen": [["A", "Brazili\u00eb"]], "Avocado": [["B", "Isra\u00ebl"], ["C", "Chili"], ["C", "Spanje"]], "Wortelen (breekpeen/waspeen)": [["A", "Nederland"]], "Carambola": [["D", "Isra\u00ebl"], ["E", "Maleisi\u00eb"]], "Radijs (los)": [["B", "Nederland"]], "Sperzieboon": [["B", "Marokko"], ["B", "Spanje"], ["C", "Senegal"], ["D", "Egypte"], ["E", "Kenia"]], "Kokosnoot": [["C", "Ivoorkust"], ["C", "Sri Lanka"], ["D", "Algerije"]], "Broccoli": [["B", "Frankrijk"], ["B", "Spanje"]], "Witte kool": [["A", "Nederland"]], "Lychee": [["C", "Madagaskar"], ["C", "Zuid-Afrika"]], "Rabarber": [["C", "Nederland"]], "Asperge (groen)": [["E", "Peru"]], "Courgette": [["A", "Spanje"]], "Rode biet": [["A", "Nederland"]], "Andijvie (gewoon)": [["A", "Spanje"], ["E", "Nederland"]], "Spitskool": [["A", "Nederland"], ["A", "Spanje"], ["B", "Portugal"]], "Ananas": [["B", "Costa Rica"], ["B", "Ecuador"]], "Kersen": [["E", "Chili"]], "Artisjok": [["B", "S
@tvwerkhoven
tvwerkhoven / MultiMarkdown_guide.md
Last active December 7, 2020 23:21
Brief introduction to MultiMarkdown highlighting features that were hard to find.
@tvwerkhoven
tvwerkhoven / rsync_backup.sh
Last active July 5, 2023 05:30 — forked from necolas/rsync_backup
Improved script: - Check if run as root - Clarify rsync(1) flags - Add --inplace for performance, extra preservation flags - Check bless(8) target before setting Improved exclusion file: - Included files listed by Carbon Copy Cloner
#!/bin/bash
#
# This script backups an OS X system to an external volume, effectively
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy
# Cloner. The latter website has an interesting list[5] on what files to
# exclude when cloning.
#
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt
#
@tvwerkhoven
tvwerkhoven / whatsapp.pm
Last active November 8, 2017 01:50
Whatsapp chat log parser for pisg
# Whatsapp log parser for pisg, made by Tim van Werkhoven
# Features: parses logs, detects subject changes
# Known issues: only works without images, does not filter out 'image omitted' texts
# Use Charset = "utf-8" in config file to enable emoji
package Pisg::Parser::Format::whatsapp;
use strict;
$^W = 1;
sub new