Skip to content

Instantly share code, notes, and snippets.

View Dhaval2404's full-sized avatar
🏠
Working from home

Dhaval Patel Dhaval2404

🏠
Working from home
View GitHub Profile
@rodydavis
rodydavis / flutter_github_ci.yml
Last active February 25, 2024 05:40
Flutter Github Actions Build and Deploy Web to Firebase Hosting, iOS to Testflight, Android to Google Play (fastlane)
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_web:
@aasaandinesh
aasaandinesh / RoomLoggingHelper.kt
Created December 9, 2018 15:11
Helper to generate logs for Room Database library
import android.annotation.SuppressLint
import androidx.room.RoomSQLiteQuery
private const val NULL = 1
private const val LONG = 2
private const val DOUBLE = 3
private const val STRING = 4
private const val BLOB = 5
private const val NULL_QUERY = "NULL"
@matteocrippa
matteocrippa / flutter.md
Last active October 26, 2023 05:47
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:

@Pulimet
Pulimet / AdbCommands
Last active April 25, 2024 19:40
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@wojteklu
wojteklu / clean_code.md
Last active April 26, 2024 03:00
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
@niksumeiko
niksumeiko / git.migrate
Last active April 25, 2024 04:04
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 18, 2024 16:07
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
@granoeste
granoeste / EachDirectoryPath.md
Last active April 4, 2024 22:32
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@slightfoot
slightfoot / SearchActivity.java
Last active October 26, 2023 12:28
SearchView example
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Locale;
import android.content.Context;
import android.content.Intent;
import android.database.AbstractCursor;
import android.database.Cursor;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;