Skip to content

Instantly share code, notes, and snippets.

@Tobiaqs
Tobiaqs / gist:9871404
Created March 30, 2014 11:25
This class allows you to preserve Objects in activities after recreation.
/**
* Allows preservation of non-context objects after i.e. rotation of the device.
*
* Usage:
*
* // Wrapper for this instance.
* private final ObjectStoreWrapper objects = new ObjectStoreWrapper(1);
*
* // Save a random Object, put the ID returned by the ObjectStore in the Bundle.
* public void onSaveInstanceState(Bundle outState) {
package tobiass.statedebt.view;
import java.io.IOException;
import java.io.InputStream;
import java.security.InvalidParameterException;
import tobiass.statedebt.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
@Tobiaqs
Tobiaqs / contact.md
Last active February 5, 2019 09:03
Contact info

Email

tobias (#) tobiass.nl

Signal

Email me for my number

Dutch version

Contact me!

Nissan Micra 1.3 from 1995, with 153153 kilometers on it. The car is currently residing in Best, near Eindhoven.

![Photo][image1]

I've had a lot of fun with this car. It has been my first car and I feel kind of regretful getting rid of it. Sadly, due to expensive insurance for young people in this country, having a car is not worth it for me anymore. The nice thing about this car is that it requires little maintenance. The mechanics are quite simple, you can do some maintenance yourself if you have the will and the tools. The car has mostly been used for highway driving. Some advantages:

English version

Neem contact op!

Nissan Micra 1.3 uit 1995, met 153153 kilometers. De auto staat in Best, bij Eindhoven,

![Photo][image1]

Ik heb heel veel plezier van deze auto gehad. Het is mijn eerste auto en ik vind het erg jammer om hem weg te doen. Helaas is het, te wijten aan de verzekering, in Nederland voor een 19-jarige erg duur om een auto te hebben. Het fijne aan deze auto is dat hij weinig onderhoud nodig heeft. Bovendien zit hij vrij simpel in elkaar, zodat je veel dingen zelf kan doen met wat handigheid. De auto is voornamelijk gebruikt op de snelweg. Hier een paar voordelen:

@Tobiaqs
Tobiaqs / gist:ba2aca172ad45083aa092514d51a8fec
Last active May 1, 2017 23:14
Detect menu-visible children in MODX chunk language
[[getResources? &limit=`1` &parents=`<id of parent resource>` &totalVar=`numChildren`]]
[[If? &subject=`[[+numChildren]]` &operator=`!=` &operand=`0` &then=`Has children` &else=`Has no children`]]
@Tobiaqs
Tobiaqs / videocollege_download.js
Created May 8, 2017 19:19
A script that leeches video files off of the TU/e's videocollege site. This is useful when you don't have a Windows PC, and hence can't use the site.
(function () {
let payload = {
getPlayerOptionsRequest: {
ResourceId: location.pathname.split('/').reverse()[0],
QueryString: location.search,
UseScreenReader: false,
UrlReferrer: document.referrer
}
};
@Tobiaqs
Tobiaqs / gist:0ef7bd2e56160650264f9b77de2db50f
Last active January 21, 2021 11:38
Turning your Raspberry Pi into a Bluetooth audio receiver (Nov 2020)

Turning your Raspberry Pi system into a Bluetooth audio receiver

with the "latest" versions of pulseaudio 12.2 and bluez/bluetoothd 5.50 in Nov 2020 in Raspbian repos

guide updated on Nov 23, 2020

There are tons of guides online that show you how to use your Raspberry Pi as a Bluetooth audio receiver. Unfortunately, at time of writing, none of them seem to work, and contain unnecessary (unexplained) steps or settings that don't really add anything useful.

If you haven't followed any guides yet, skip to the TRUTHS part. If you have, the LIES part may clarify some things for you.

LIES

@Tobiaqs
Tobiaqs / install_woolbird.sh
Last active May 19, 2022 10:37
Script that can transform a mint raspbian installation into a media center with external I2S DAC that runs Kodi and can play audio over the network and bluetooth via pulseaudio
#!/bin/bash
# this script sets up a mint raspbian installation as follows:
# - all packages updated
# - my public ssh key is authorized
# - onboard bluetooth disabled
# - onboard analog audio disabled
# - PCM5102a DAC as audio output
# - network audio relay through pulseaudio with zeroconf support
# - bluetooth audio relay through pulseaudio
@Tobiaqs
Tobiaqs / install_sandman.sh
Last active September 23, 2019 19:50
Very basic bootstrap script for RPi
#!/bin/bash
# this script sets up a mint raspbian installation as follows:
# - all packages updated
# - nfs & ntfs-3g installed
# - mount point for hard drive on /dev/sda1 is created and ownership is granted to pi:pi
# - nfs share is created for this mount point and access is given to $WOOLBIRD_IP
# - my public ssh key is authorized
# - hostname of the installation set to $NEW_HOSTNAME