Skip to content

Instantly share code, notes, and snippets.

View Abdelsattar's full-sized avatar
🎮
Playing with code

Sattar Abdelsattar

🎮
Playing with code
View GitHub Profile
@Abdelsattar
Abdelsattar / InstantExecutorExtension
Created March 21, 2021 15:35
Fix problem live data with Junit 5
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
Abdelsattar / bintray_script
Created January 31, 2019 20:48
bintray script for lib
group = publishedGroupId
version = libraryVersion
install {
repositories.mavenInstaller {
pom.project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
@Abdelsattar
Abdelsattar / key hash for facebook
Created July 28, 2017 22:34
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
// 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,
public class CheckBoxHolder extends TreeNode.BaseNodeViewHolder<CheckBoxHolder.IconTreeItem> {
boolean isChild;
public CheckBoxHolder(Context context, boolean isChild) {
super(context);
this.isChild = isChild;
}