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
rohan20 / sound_null_safety_progress.py
Created January 6, 2023 15:36
measure-flutter-dart-sound-null-safety-migration-progress
# 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
munificent / hidden_forward.md
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:

some_app.dart:

@sienatime
sienatime / AppDatabase.java
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
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 news.ycombinator.com. 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: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools
defaultConfig {
applicationId "samples.linhtruong.com.ui_reactive_rxjava_realm"
minSdkVersion versions.minSdk
@up1
up1 / LoadingView.java
Last active February 12, 2021 17:13
Android Testing :: Custom View with Robolectric
public class LoadingView extends RelativeLayout {
public LoadingView(Context context) {
super(context);
}
public LoadingView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public LoadingView(Context context, AttributeSet attrs, int defStyle) {
@segunfamisa
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: 'com.android.application'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
applicationId "com.segunfamisa.gradleextraproperties"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
@baconpat
baconpat / RecycleViewMatcher.java
Created March 30, 2016 01:13
RecycleViewMatcher (updated for scrolling)
package com.foo.RecyclerViewMatcher;
import android.content.res.Resources;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
@gabrielemariotti
gabrielemariotti / README.md
Last active February 24, 2021 10:52
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

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:

root
  --gradleScript
 ----dependencies.gradle