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;

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 / contact.md
Last active February 5, 2019 09:03
Contact info

Email

tobias (#) tobiass.nl

Signal

Email me for my number

@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
@Tobiaqs
Tobiaqs / tutorial.md
Last active January 15, 2020 12:34
Using Github/Bitbucket as an encrypted file backup service

Initial setup

This will get you a repository that automatically encrypts all files that you add to it and push.

  1. Get git and git-crypt and gpg
  2. Make sure you have a trusted private key in gpg
  3. Run git-crypt init in the root of your repo
  4. Run git-crypt add-gpg-user GPG_FINGERPRINT
  5. Create .gitattributes in the root of your repo
**/* filter=git-crypt diff=git-crypt
@Tobiaqs
Tobiaqs / install_woolbird_lite.sh
Last active June 12, 2020 23:39
Script that can transform a mint Raspberry Pi OS / Raspbian installation into a Bluetooth audio receiver
#!/bin/bash
# this script sets up a mint raspbian installation as follows:
# - all packages updated
# - my public ssh key is authorized
# - bluetooth audio relay through pulseaudio
# - hostname of the installation set to $NEW_HOSTNAME
#
# tested on Raspberry Pi OS on June 13, 2020
# note: you need to connect to your device with bluetoothctl, if you want the opposite to be possible, trust your device.