Skip to content

Instantly share code, notes, and snippets.

Playing with code

Sattar Abdelsattar

Playing with code
View GitHub Profile
Abdelsattar / InstantExecutorExtension
Created Mar 21, 2021
Fix problem live data with Junit 5
View InstantExecutorExtension
import androidx.arch.core.executor.ArchTaskExecutor
import androidx.arch.core.executor.TaskExecutor
import org.junit.jupiter.api.extension.AfterEachCallback
import org.junit.jupiter.api.extension.BeforeEachCallback
import org.junit.jupiter.api.extension.ExtensionContext
class InstantExecutorExtension : BeforeEachCallback, AfterEachCallback {
override fun beforeEach(context: ExtensionContext?) {
ArchTaskExecutor.getInstance().setDelegate(object : TaskExecutor() {
Abdelsattar / bintray_script
Created Jan 31, 2019
bintray script for lib
View bintray_script
group = publishedGroupId
version = libraryVersion
install {
repositories.mavenInstaller {
pom.project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
Abdelsattar / key hash for facebook
Created Jul 28, 2017
this is the method that will generate for you the key hash of your machine to add it to your facebook app page on developer
View key hash for facebook
// will generate key hash for android for facebook
public String printKeyHash() {
PackageInfo packageInfo;
String key = null;
try {
//getting application package name, as defined in manifest
String packageName = this.getApplicationContext().getPackageName();
//Retriving package info
packageInfo = this.getPackageManager().getPackageInfo(packageName,
View CheckBoxHolder
public class CheckBoxHolder extends TreeNode.BaseNodeViewHolder<CheckBoxHolder.IconTreeItem> {
boolean isChild;
public CheckBoxHolder(Context context, boolean isChild) {
this.isChild = isChild;