Skip to content

Instantly share code, notes, and snippets.

View burhanrashid52's full-sized avatar
Every day, Every hour, Turn pain into power.

Burhanuddin Rashid burhanrashid52

Every day, Every hour, Turn pain into power.
View GitHub Profile
rohan20 /
Created January 6, 2023 15:36
# Measures sound-null-safety migration progress.
# Does so by checking total number of dart files and number of Dart files with the either of the following 3 statements:
# - "// @dart=2.9"
# - "// ignore: import_of_legacy_library_into_null_safe"
# - "// ignore_for_file: import_of_legacy_library_into_null_safe"
import itertools
import os
import sys
munificent /
Last active February 21, 2023 11:16
The "hidden forwarders" pattern in Dart

Say you have a package my_stuff. It contains two classes, A and B. You want to store them in separate files, but A needs access to some private functionality of B (in this case, the method _secret() and the constructor B._magic()). You don't want to expose that functionality outside of the package. You can express that like this:

The app using your package does:


sienatime /
Last active September 25, 2020 12:31
Code snippets for adding FTS support to Room (Android architecture components)
@Database(entities = {
Entry.class, Sense.class, CrossReference.class, EntryFts.class
}, version = 4, exportSchema = false) public abstract class AppDatabase extends RoomDatabase
codediodeio / database.rules.json
Last active June 22, 2024 07:03
Common Database Rules for Firebase
// No Security
"rules": {
".read": true,
".write": true

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.

Effective Engineer - Notes

What's an Effective Engineer?

apply plugin: ''
apply plugin: 'android-apt'
android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools
defaultConfig {
applicationId ""
minSdkVersion versions.minSdk
up1 /
Last active February 12, 2021 17:13
Android Testing :: Custom View with Robolectric
public class LoadingView extends RelativeLayout {
public LoadingView(Context context) {
public LoadingView(Context context, AttributeSet attrs) {
super(context, attrs);
public LoadingView(Context context, AttributeSet attrs, int defStyle) {
segunfamisa / app-module-build.gradle
Last active June 22, 2020 11:43
Using gradle extra properties to manage Android dependency versioning
// app module build.gradle
apply plugin: ''
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
applicationId "com.segunfamisa.gradleextraproperties"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
baconpat /
Created March 30, 2016 01:13
RecycleViewMatcher (updated for scrolling)
import android.content.res.Resources;
import android.view.View;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
gabrielemariotti /
Last active February 24, 2021 10:52
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like: