Skip to content

Instantly share code, notes, and snippets.

View johnjohndoe's full-sized avatar

Tobias Preuss johnjohndoe

View GitHub Profile
@johnjohndoe
johnjohndoe / schedule.xml
Last active December 21, 2017 22:51
34C3 Fahrplan XML, indented
<?xml version="1.0" encoding="UTF-8"?>
<schedule>
<version>Bikinihaus</version>
<conference>
<acronym>34c3</acronym>
<title>34th Chaos Communication Congress</title>
<start>2017-12-27</start>
<end>2017-12-31</end>
<days>4</days>
<timeslot_duration>00:15</timeslot_duration>
@johnjohndoe
johnjohndoe / EnumWithDefaultValueJsonAdapter.java
Last active March 24, 2022 08:27 — forked from NightlyNexus/EnumWithDefaultValueJsonAdapter.java
An enum JsonAdapter for Moshi that allows for a fallback value when deserializing unknown strings. NOTE: Allows null for the default. https://github.com/square/moshi/blob/master/moshi-adapters/src/main/java/com/squareup/moshi/adapters/EnumJsonAdapter.kt
import com.squareup.moshi.Json;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.JsonReader;
import com.squareup.moshi.JsonWriter;
import java.io.IOException;
public final class EnumWithDefaultValueJsonAdapter<T extends Enum<T>> extends JsonAdapter<T> {
private final Class<T> enumType;
private final String[] nameStrings;
private final T[] constants;
@johnjohndoe
johnjohndoe / android-things-ubuntu-udev.md
Last active May 22, 2018 00:24
How to connect Pico i.MX7 Dual Development Board on Ubuntu

How to connect Pico i.MX7 Dual Development Board on Ubuntu

If you facing the following error message when you try to access your device via adb ...

error: insufficient permissions for device: udev requires plugdev group membership

... then you might find the following tutorial helpful.

1) Create a udev rule for your device

@johnjohndoe
johnjohndoe / qgis-start-commands.md
Created October 20, 2017 16:42
Custom QGIS start command in alacarte

QGIS Browser

env LD_LIBRARY_PATH=/home/user/bin/qgis/lib /home/user/bin/qgis/bin/qbrowser %F

QGIS Desktop

env LD_LIBRARY_PATH=/home/user/bin/qgis/lib /home/user/bin/qgis/bin/qgis %F
@johnjohndoe
johnjohndoe / droidcon-2017-sessions-request
Created September 6, 2017 13:55
droidcon-2017-sessions
GET /rest/sessions.json HTTP/1.1
Host: droidcon.de
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.8.1
If-None-Match: "1504612579-1"
@johnjohndoe
johnjohndoe / droidcon-2017-speakers-request
Created September 6, 2017 13:54
droidcon-2017-speakers
GET /rest/speakers.json HTTP/1.1
Host: droidcon.de
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.8.1
If-None-Match: "1504612578-1"
@johnjohndoe
johnjohndoe / droidcon-2017-rooms-request
Created September 6, 2017 13:52
droidcon-2017-rooms
GET /rest/rooms.json HTTP/1.1
Host: droidcon.de
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.8.1
If-None-Match: "1504612577-1"
GET /eventfeed/0?start=2017-09-04&end=2017-09-05 HTTP/1.1
Host: droidcon.de
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.8.0
@johnjohndoe
johnjohndoe / adb-screenshot
Created August 26, 2017 10:57
ADB command to capture a screenshot from a device
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > output.png
@johnjohndoe
johnjohndoe / pizzateig.md
Last active June 4, 2017 11:33
Pizzateig Rezept

Pizzateig

Zutaten für 2 Personen

  • 250 g Mehl
  • 1 TL Salz
  • 1 EL Olivenöl
  • 10 g Hefe
  • 150 ml Wasser
  • lauwarmes Olivenöl zum Beträufeln