Skip to content

Instantly share code, notes, and snippets.

View idrisbohra's full-sized avatar

Idris Bohra idrisbohra

  • Dubai, United Arab Emirates
View GitHub Profile
# This is a configuration file for ProGuard.
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
-dontpreverify
# Enable Optimization. # Optimization is turned off by default.
-optimizations code/simplification/arithmetic,!code/simplification/cast,!field
@hormesiel
hormesiel / Device.java
Last active May 29, 2024 11:47
How to get an Android device's serial number, visible to the user in "Settings > About phone/tablet/device > Status > Serial number".
import android.os.Build;
import java.lang.reflect.Method;
public class Device {
/**
* @return The device's serial number, visible to the user in {@code Settings > About phone/tablet/device > Status
* > Serial number}, or {@code null} if the serial number couldn't be found
*/
public static String getSerialNumber() {
@omarmiatello
omarmiatello / EasyWS.kt
Last active June 4, 2024 13:37
First experiment with WebSocket and Kotlin Coroutine
import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.channels.Channel
import kotlinx.coroutines.experimental.launch
import okhttp3.*
import okio.ByteString
import kotlin.coroutines.experimental.suspendCoroutine
/**
* Created by omarmiatello on 17/06/17.
*/
@nesquena
nesquena / SnappyRecyclerView.java
Last active June 21, 2023 23:04
Snap-to-Center RecyclerView Extension
// From: http://stackoverflow.com/a/37816976
public class SnappyRecyclerView extends RecyclerView {
// Use it with a horizontal LinearLayoutManager
// Based on http://stackoverflow.com/a/29171652/4034572
public SnappyRecyclerView(Context context) {
super(context);
}