Skip to content

Instantly share code, notes, and snippets.

View JoachimR's full-sized avatar

Joachim Reiß JoachimR

  • https://bryter.com
  • Germany
View GitHub Profile
@JoachimR
JoachimR / bookmarklet gitlab MR
Last active March 13, 2023 18:22
javascript bookmarklet to put a merge request message into clipboard from https://gitlab.com/.../merge_requests/<number>
javascript: (() => { navigator.clipboard.writeText(":merge-request: *" + document.querySelector('.page-title').textContent.trim() + "*" + "\n" + document.URL ) })();
@JoachimR
JoachimR / terminal.txt
Last active January 2, 2021 17:40
create android release on terminal
adb uninstall com.your.package &&
./gradlew assembleRelease &&
cp app/build/outputs/apk/release/app-release.apk /Users/userName/Desktop/. &&
adb install -r /Users/userName/Desktop/app-release.apk &&
adb shell am start -n com.your.package/com.your.package.SplashScreenActivity
@JoachimR
JoachimR / TestUtils.kt
Created December 4, 2017 09:44
Android Espresso SwipeToRefreshLayout assert isRefreshing state
import android.support.annotation.IdRes
import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.matcher.ViewMatchers.withId
import android.support.v4.widget.SwipeRefreshLayout
import android.view.View
import org.hamcrest.Description
import org.hamcrest.Matchers.not
import org.hamcrest.TypeSafeMatcher
@JoachimR
JoachimR / ChooseDayDialog.kt
Created November 20, 2017 15:39
ChooseDayDialog with optional request code
import android.app.DatePickerDialog
import android.app.Dialog
import android.os.Bundle
import android.support.v4.app.DialogFragment
import java.util.*
class ChooseDayDialog : DialogFragment() {
@JoachimR
JoachimR / persons.json
Last active August 9, 2016 22:38
random persons with gender sample data as json
{
"person_list": [
{
"firstName": "Angela",
"gender": "female",
"lastName": "Rikard"
},
{
"firstName": "Yolanda",
"gender": "female",
package my;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteException;
import android.util.Log;
import my.DaoMaster;
@JoachimR
JoachimR / btn_flat_compat___v11.xml
Created December 19, 2015 12:04
Android material flat button v7 compat
<?xml version="1.0" encoding="utf-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/btn_flat"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="btn_flat"
android:textColor="@color/colorAccent"
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import org.json.JSONArray;
import org.json.JSONException;
import android.content.Context;
import android.support.annotation.NonNull;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.data.DataFetcher;
import com.bumptech.glide.load.model.stream.StreamModelLoader;