Skip to content

Instantly share code, notes, and snippets.

View johnjohndoe's full-sized avatar

Tobias Preuss johnjohndoe

View GitHub Profile
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 / 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.
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user =[:user])
render json: user.as_json(auth_token: user.authentication_token, email:, status: :created
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 / 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
johnjohndoe /
Last active July 22, 2018 16:28 — forked from DanielThomas/
A color script for the console output of maven.
# Written by Mike Ensor (
# Copywrite 2012
# Use as needed, modify, have fun!
# This is intended to be used for Maven3 + Mac OSX
# To use:
# in your ".bashrc" or ".bash_profile" add the following line:
# source ~/<path to script>/
* The plugins used for this build.
* Provides the compile, test, jar, etc tasks
apply plugin: 'java'
* Generates the Eclipse project files.