Skip to content

Instantly share code, notes, and snippets.

package com.truecaller.sdk.samples
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.truecaller.android.sdk.ITrueCallback
import com.truecaller.android.sdk.TrueError
import com.truecaller.android.sdk.TrueProfile
package com.truecaller.sdk.samples
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.Glide
import com.truecaller.android.sdk.TrueProfile
import kotlinx.android.synthetic.main.create_profile_activity.avatarImageView
import kotlinx.android.synthetic.main.create_profile_activity.emailEditText
@DevHossamHassan
DevHossamHassan / FileInformation.java
Created May 3, 2020 14:13 — forked from VassilisPallas/FileInformation.java
get file information from URI
import android.annotation.TargetApi;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.provider.OpenableColumns;
/**
* You can edit, run, and share this code.
* play.kotlinlang.org
*/
fun main() {
val st = """&yet andyet.com Worldwide
10up 10up.com Worldwide
15Five 15five.com Europe, Americas
17hats 17hats.com Worldwide
@DevHossamHassan
DevHossamHassan / EventBus.kt
Created January 12, 2020 19:26
Kotlin coroutine-based event bus
import kotlinx.coroutines.experimental.DefaultDispatcher
import kotlinx.coroutines.experimental.channels.BroadcastChannel
import kotlinx.coroutines.experimental.channels.ReceiveChannel
import kotlinx.coroutines.experimental.channels.filter
import kotlinx.coroutines.experimental.channels.map
import kotlinx.coroutines.experimental.launch
import kotlin.coroutines.experimental.CoroutineContext
class EventBus {
@DevHossamHassan
DevHossamHassan / RxBus1.java
Created January 29, 2018 10:32 — forked from jaredsburrows/RxBus1.java
RxBus for RxJava 1 and RxJava 2
import rx.Observable;
import rx.subjects.PublishSubject;
import rx.subjects.SerializedSubject;
import rx.subjects.Subject;
/**
* @author <a href="mailto:jaredsburrows@gmail.com">Jared Burrows</a>
*/
public final class RxBus {
private final Subject<Object, Object> bus = new SerializedSubject<>(PublishSubject.create());
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.text.TextUtils;
import your.package.R;
public class NavigationManager {
private FragmentManager mFragmentManager;
@DevHossamHassan
DevHossamHassan / GitCommitEmoji.md
Created October 2, 2017 22:40 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@DevHossamHassan
DevHossamHassan / ArrayUtil.java
Created June 22, 2017 01:11 — forked from mfmendiola/ArrayUtil.java
ReadableArray and ReadableMap serialization helpers for the React Native—Android bridge.
/*
ArrayUtil exposes a set of helper methods for working with
ReadableArray (by React Native), Object[], and JSONArray.
*/
package com.iodine.start;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReadableArray;
@DevHossamHassan
DevHossamHassan / git-tag-delete-local-and-remote.sh
Created January 30, 2017 19:59 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName