Skip to content

Instantly share code, notes, and snippets.

View johnjohndoe's full-sized avatar

Tobias Preuss johnjohndoe

View GitHub Profile
@johnjohndoe
johnjohndoe / vcard-split.py
Last active December 25, 2023 06:30 — forked from umrashrf/vcard-split.py
Python script to split Google contacts into individual VCF files.
#!/usr/bin/python
#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
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;
[
{
"author": "CCC",
"conference": "33C3",
"description": "Live-Streaming vom 33C3",
"endsAt": "2016-12-30T20:00:00+0000",
"groups": [
{
"group": "Live",
"rooms": [
@johnjohndoe
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 https://github.com/dkandalov/live-plugin
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
johnjohndoe / README.md
Last active March 7, 2020 13:50 — forked from Wikinaut/README.md
Vereinfachte Verkehrsordnungswidrigkeitenanzeige bei Halt- und Parkverstößen per E-Mail an die Bußgeldstelle. https://twitter.com/tbsprs/status/1236287577981964289
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render json: user.as_json(auth_token: user.authentication_token, email: user.email), status: :created
return
else
@johnjohndoe
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: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use
@johnjohndoe
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
[alias]
# 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
johnjohndoe / colorize-maven.sh
Last active July 22, 2018 16:28 — forked from DanielThomas/colorize-maven.sh
A color script for the console output of maven.
#!/bin/sh
# Written by Mike Ensor (mike@ensor.cc)
# 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>/colorize-maven.sh
/*
* The plugins used for this build.
*/
/*
* Provides the compile, test, jar, etc tasks
*/
apply plugin: 'java'
/*
* Generates the Eclipse project files.