Skip to content

Instantly share code, notes, and snippets.

#How I built an audio book reader for my nearly blind grandfather

Tweet this - Follow me

Last year, when visiting my family back home in Holland, I also stopped by my grand-parents. My grand-father, now 93 years old, had always been a very active man. However, during the presceding couple of months, he'd gone almost completely blind and now spent his days sitting in a chair. Trying to think of something for him to do, I suggested he try out audio books. After finally convincing him -- he said audio books were for sad old people -- that listening to a well performed recording is actually a wonderful experience, I realized the problem of this idea.

####The problem with audio devices and the newly blind. After my first impulse to jump up and go buy him an iPod Touch, I soon realized that, to use an iPod, or any audio d

<?php
/**
* This little class records how long it takes each WordPress action or filter
* takes to execute which gives a good indicator of what hooks are being slow.
* You can then debug those hooks to see what hooked functions are causing problems.
*
* This class does NOT time the core WordPress code that is being run between hooks.
* You could use similar code to this that doesn't have an end processor to do that.
*
<?php
/**
* An example function used to demonstrate how to use the `user_can_save` function
* that provides boilerplate security checks when saving custom post meta data.
*
* The ultimate goal is provide a simple helper function to be used in themes and
* plugins without the need to use a set of complex conditionals and constants.
*
* Instead, the aim is to have a simplified function that's easy to read and that uses
* WordPress APIs.
@sosukeinu
sosukeinu / wp_tax_bread_functions.php
Last active December 11, 2015 17:49 — forked from billerickson/gist:1325540
WP function taxonomy breadcrumbs
<?php
/* Taxonomy Breadcrumb */
function be_taxonomy_breadcrumb() {
// Get the current term
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
// Create a list of all the term's parents
$parent = $term->parent;
while ($parent):
$parents[] = $parent;
@sosukeinu
sosukeinu / Preferences.sublime-settings
Created January 25, 2013 20:11 — forked from fpinzn/Preferences.sublime-settings
CONFIG Sublime Text 2 settings
// While you can edit this file, it's best to put your changes in
// "User/Preferences.sublime-settings", which overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme",
// Note that the font_face and font_size are overriden in the platform
@sosukeinu
sosukeinu / Sublime-Text2-useful-shortcuts.md
Last active December 11, 2015 17:49 — forked from mingliangguo/gist:3291698
CONFIG Sublime Text 2 useful shortcuts

h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)

h2. General

| ⌘T | go to file | | ⌘⌃P | go to project | | ⌘R | go to methods | | ⌃G | go to line | | ⌘KB | toggle side bar | | ⌘⇧P | command prompt |

@sosukeinu
sosukeinu / rss-subscribers.sh
Created January 25, 2013 20:11 — forked from btobolaski/rss-subscribers.sh
BASH cron job to list RSS subscribers
#!/bin/bash
# A modification of Marco Arment's script at
#
# https://gist.github.com/3783146
#
# It's intended to be run once a day as a cron job. The main
# differences between it and Marco's script are:
#
# 1. It checks two feeds instead of just one.
@sosukeinu
sosukeinu / backup.sh
Created January 25, 2013 20:11
BASH backup script
#!/bin/bash
year="$1"
month="$2"
day="$3"
server_name='interactivedept'
backup_repository() {
repo_name="$1"
svnadmin hotcopy /home/repo/$repo_name /home/backup/$repo_name-repo
@sosukeinu
sosukeinu / installed_packages.sh
Created January 25, 2013 20:11 — forked from pmbuko/installed_packages.sh
BASH list installed packages
#!/bin/bash
for log in $(/bin/ls -r /var/log/install.log*); do
bzgrep 'Writing receipt' $log | awk '{print $1,$2,$3,$10}'
done
@sosukeinu
sosukeinu / page_range.py
Created January 25, 2013 20:11 — forked from danshultz/page_range.py
PYTHON detecting consecutive integers in a list
# Ref from http://stackoverflow.com/questions/2361945/detecting-consecutive-integers-in-a-list
from itertools import groupby
from operator import itemgetter
class PageRange(object):
@staticmethod
def to_text_range(array_of_numbers):
text_buffer = []