Skip to content

Instantly share code, notes, and snippets.

@hisetu
hisetu / sonarqube-docker-compose.yml
Created July 18, 2020 11:42 — forked from Warchant/sonarqube-docker-compose.yml
docker-compose file to setup production-ready sonarqube
version: "3"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:
@hisetu
hisetu / sign apk
Created July 21, 2020 14:27
sign apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore "your.jks" your.apk alias
@hisetu
hisetu / Dockerfile
Created September 4, 2020 04:06 — forked from atsushieno/Dockerfile
fluidsynth for Android docker build
FROM bitriseio/android-ndk
WORKDIR /usr/local/src
ENV ANDROID_NDK_PATH /opt/android-ndk
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
@hisetu
hisetu / gist:1043b00d84bcfd7525e14cafe76e16bb
Created November 13, 2020 10:16 — forked from RikkaW/gist:0ae7f51117768a03c6581c956d75958c
insert general file with MediaStore
Context context = view.getContext();
ContentResolver cr = context.getContentResolver();
ContentValues values;
try {
// create a file for test
File file = new File(context.getFilesDir(), "1234568");
file.createNewFile();
try (OutputStream os = new FileOutputStream(file)) {
os.write("test".getBytes());
@hisetu
hisetu / GridSpacingItemDecoration.md
Created May 11, 2021 03:28 — forked from cxyxlxdm/GridSpacingItemDecoration.md
Add column spacing in RecyclerView with GridLayoutManager

Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
@hisetu
hisetu / fluid-android-compile.sh
Created June 1, 2021 11:45 — forked from santoxyz/fluid-android-compile.sh
Script for cross compiling fluidsynth for Android
#!/bin/bash
# Android cross-compile environment setup script for Fluidsynth, Glib and dependencies
# Author : Tom Moebert
# Date : 2018-09-06
# License : CC0 1.0 Universal
# If you have questions or need support, contact our mailing list:
# https://lists.nongnu.org/mailman/listinfo/fluid-dev
set -ex
@hisetu
hisetu / fluid-android-prepare.sh
Created June 1, 2021 11:46 — forked from santoxyz/fluid-android-prepare.sh
Shell file to set up various environment variables to allow cross compilation for Android
#!/bin/bash
# Android cross-compile environment setup script for Glib
# Author : Zengwen Yuan
# Date : 2016-07-16
# License : Creative Commons Attribution-ShareAlike 4.0
# http://zwyuan.github.io/2016/07/17/cross-compile-glib-for-android/
#
# Modified by Tom Moebert to provide an Android cross compilation toolchain for fluidsynth 2.0
# Date: 2018-09-06
@hisetu
hisetu / NoRipple.kt
Last active July 3, 2022 10:06
Jetpack Compose Modifier
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.selection.selectable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
inline fun Modifier.noRippleClickable(crossinline onClick: () -> Unit): Modifier = composed {
clickable(indication = null,
interactionSource = remember { MutableInteractionSource() }) {
@hisetu
hisetu / ActivityIntentState.kt
Last active July 3, 2022 10:10
Kotlin Extensions
fun Activity.getStringFromIntentOrState(field: String, savedInstanceState: Bundle?): String? =
when {
intent.getStringExtra(field) != null -> intent.getStringExtra(field)
savedInstanceState?.getString(field) != null -> savedInstanceState.getString(field)
else -> null
}
@hisetu
hisetu / AllGattCharacteristics.java
Created March 4, 2022 16:10 — forked from sam016/AllGattCharacteristics.java
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");