Skip to content

Instantly share code, notes, and snippets.

View johnjohndoe's full-sized avatar

Tobias Preuss johnjohndoe

View GitHub Profile
johnjohndoe / FindMatchesAction.groovy
Created July 6, 2020 12:57 — forked from jbarr21/FindMatchesAction.groovy
IntelliJ plugin to perform multiple structural search and replace actions. Can be installed with
import com.intellij.openapi.actionSystem.*
import com.intellij.openapi.application.*
import com.intellij.openapi.command.*
import com.intellij.openapi.diagnostic.*
import com.intellij.openapi.fileTypes.*
import com.intellij.openapi.progress.*
import com.intellij.openapi.project.*
import com.intellij.openapi.ui.*
import com.intellij.openapi.vfs.*
import com.intellij.psi.*
johnjohndoe /
Last active March 7, 2020 13:50 — forked from Wikinaut/
Vereinfachte Verkehrsordnungswidrigkeitenanzeige bei Halt- und Parkverstößen per E-Mail an die Bußgeldstelle.
johnjohndoe / 60-jetbrains.conf
Created June 23, 2019 13:16 — forked from bittner/60-jetbrains.conf
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source:
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use
johnjohndoe /
Last active December 25, 2023 06:30 — forked from umrashrf/
Python script to split Google contacts into individual VCF files.
#split vcf files
import re
working_dir = '/home/umair/Documents/Contacts/'
input_file = 'contacts starred 26-06-2014.vcf'
output_seed = 'contacts-part-'
vcards_per_file = 1
johnjohndoe /
Last active March 24, 2022 08:27 — forked from NightlyNexus/
An enum JsonAdapter for Moshi that allows for a fallback value when deserializing unknown strings. NOTE: Allows null for the default.
import com.squareup.moshi.Json;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.JsonReader;
import com.squareup.moshi.JsonWriter;
public final class EnumWithDefaultValueJsonAdapter<T extends Enum<T>> extends JsonAdapter<T> {
private final Class<T> enumType;
private final String[] nameStrings;
private final T[] constants;
"author": "CCC",
"conference": "33C3",
"description": "Live-Streaming vom 33C3",
"endsAt": "2016-12-30T20:00:00+0000",
"groups": [
"group": "Live",
"rooms": [
johnjohndoe /
Created December 15, 2016 11:55 — forked from tasomaniac/
Screen Record for Android
set -e
if [ -z "$1" ]; then
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4
johnjohndoe / config
Created August 1, 2016 22:05 — forked from donnfelker/config
Watch or Unwatch a file in git
# Goes in your .git/config file
# Temporarily stop tracking a file in git.
# usage: git unwatch path/to/file
unwatch = update-index --assume-unchanged
# Resume tracking a file in git.
# usage: git watch path/to/file
watch = update-index --no-assume-unchanged


Here, you might lay out the reasons behind writing this code. You can link to specs, issues, or bugs in order to give someone a better idea of how a decision was made. This is your chance to give context to your reviewer. Ego depletion - the idea that willpower is used up over time - can be easily applied to your reviewer. We are human, after all. You'll likely get one shot at a quality review, so help your reviewer help you. Flush out this section.


How did you test this code? Did you write a unit test, or test it manually? Can you provide an animated gif or a screenshot to demonstrate your code does what it purports to do? What about test output or a useful snippet from a logfile? Help show that your code works.

🚨🚨🚨 (Risks)

Is there some part of the code that you know probably doesn't work as it should? Call out potential weak spots, and get help addressing them.

johnjohndoe /
Created March 28, 2016 15:51 — forked from anonymous/
Matchers file from Episode 29 of Caster.IO - Creating Custom ViewMatchers
package com.donnfelker.tasko;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;