Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Preuss johnjohndoe

View GitHub Profile
@jbarr21
jbarr21 / FindMatchesAction.groovy
Last active Jul 6, 2020
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.*
@cyroxx
cyroxx / jitsi.md
Last active Apr 3, 2020
Install jitsi
View jitsi.md
@burntcookie90
burntcookie90 / linguist-runner.sh
Last active Apr 3, 2020
runs linguist on ever commit since a date
View linguist-runner.sh
#!/usr/bin/bash
for commit in $(git --no-pager log --reverse --after="2016-10-01T10:36:00-07:00" --pretty=format:%H)
do
echo $commit
git checkout $commit
#write linguist data to a file
echo "" >> ~/repo-linguist-report.txt
echo "commit: $commit" >> ~/repo-linguist-report.txt
@davidvavra
davidvavra / NonNullAssertionDetector.kt
Created Mar 22, 2019
Lint check for detecting non-null assertion (!!) in your code
View NonNullAssertionDetector.kt
import com.android.tools.lint.client.api.UElementHandler
import com.android.tools.lint.detector.api.*
import org.jetbrains.uast.UElement
import org.jetbrains.uast.UPostfixExpression
class NonNullAssertionDetector : Detector(), Detector.UastScanner {
override fun getApplicableUastTypes(): List<Class<out UElement>>? {
return listOf(UPostfixExpression::class.java)
}
@cketti
cketti / android-27-sources.md
Created Dec 18, 2017
Build your own android-27 sources
View android-27-sources.md

Build "Sources for Android 27" so you can comfortably browse the Android API source in Android Studio.

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base
@johnjohndoe
johnjohndoe / android-things-ubuntu-udev.md
Last active May 22, 2018
How to connect Pico i.MX7 Dual Development Board on Ubuntu
View android-things-ubuntu-udev.md

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

View Data.kt
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@NightlyNexus
NightlyNexus / EnumWithDefaultValueJsonAdapter.java
Last active Dec 14, 2018
Update: This is now in the Moshi adapters artifact. https://github.com/square/moshi/blob/5153295988e09e6a1bfe76eecff8b22bf49e25de/adapters/src/main/java/com/squareup/moshi/adapters/EnumJsonAdapter.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;
@johnjohndoe
johnjohndoe / apt-packages
Last active Jun 20, 2020
Ubuntu APT packages
View apt-packages
alacarte
brave-browser
caffeine
charles-proxy
chromium-browser
clamav
clamtk
compiz-plugins-extra
compizconfig-settings-manager
darktable
View BaseRecyclerViewAdapter.java
package com.yourpackage.android;
import android.content.Context;
import android.support.annotation.CallSuper;
import android.support.annotation.IdRes;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
You can’t perform that action at this time.