Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Preuss johnjohndoe

View GitHub Profile
@johnjohndoe
johnjohndoe / FindMatchesAction.groovy
Created Jul 6, 2020 — 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
View FindMatchesAction.groovy
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 Mar 7, 2020 — 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
View README.md
@johnjohndoe
johnjohndoe / 60-jetbrains.conf
Created Jun 23, 2019 — 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`
View 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 / vcard-split.py
Last active Sep 7, 2018 — forked from umrashrf/vcard-split.py
Python script to split Google contacts into individual VCF files.
View vcard-split.py
#!/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
Created Dec 14, 2017 — 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.
View EnumWithDefaultValueJsonAdapter.java
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;
View streams-v2.json
[
{
"author": "CCC",
"conference": "33C3",
"description": "Live-Streaming vom 33C3",
"endsAt": "2016-12-30T20:00:00+0000",
"groups": [
{
"group": "Live",
"rooms": [
@johnjohndoe
johnjohndoe / screenrecord.sh
Created Dec 15, 2016 — forked from tasomaniac/screenrecord.sh
Screen Record for Android
View screenrecord.sh
#!/bin/sh
set -e
if [ -z "$1" ]; then
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4
else
shot_path="$*"
fi
@johnjohndoe
johnjohndoe / config
Created Aug 1, 2016 — forked from donnfelker/config
Watch or Unwatch a file in git
View config
# 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
View pull_request_template.md

Overview

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.

Testing

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
johnjohndoe / TaskoMatchers.java
Created Mar 28, 2016 — forked from anonymous/TaskoMatchers.java
Matchers file from Episode 29 of Caster.IO - Creating Custom ViewMatchers
View TaskoMatchers.java
package com.donnfelker.tasko;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.support.test.espresso.matcher.BoundedMatcher;
import android.text.TextUtils;
import android.view.View;
You can’t perform that action at this time.