Skip to content

Instantly share code, notes, and snippets.

View GAM3RG33K's full-sized avatar

GAM3RG33K

View GitHub Profile
@GAM3RG33K
GAM3RG33K / ReadMe.md
Last active September 13, 2023 06:36
maestro.mobile.dev - ReadMe.md for beginners
@GAM3RG33K
GAM3RG33K / main.dart
Last active December 30, 2021 03:39
Dart implementation for Filter Duplicate numbers
void main() {
/// Mock list of contacts
final _rawContacts = [
// Actual Number: 9000000000
"+919000000000",
"+9190000 00000",
"+91900-000-0000",
"919000000000",
"9190000 00000",
"91900-000-0000",
@GAM3RG33K
GAM3RG33K / offline_sync_manager.dart
Created December 14, 2021 12:57
[Basic] Manage Data to Sync when Offline
import 'package:async/async.dart';
import 'package:dartz/dartz.dart';
/// Pub Packages if not already install
///
/// # Utility Extensions to existing dart classes & methods
/// dartz: ^0.10.1
///
/// # Asynchronous Operation Utilities
/// async: ^2.8.1
@GAM3RG33K
GAM3RG33K / image_process_utils.dart
Created December 3, 2021 12:18
Find Brightness from the image provider
import 'package:flutter/material.dart';
// Add this to pubspec.yaml of your flutter project
// palette_generator: ^0.3.2
// get packages to download the package
import 'package:palette_generator/palette_generator.dart';
/// This method will find & return the most dominant color from the image
@GAM3RG33K
GAM3RG33K / ReadMe.md
Created December 1, 2021 07:20
flutter clean on a collection of projects

Python program to clean all flutter projects from where the script is called

Date: 01-12-2021 Author: Harshvardhan Joshi

Requirements:

  • flutter installed & accessible from cmd
  • python3 installed & accessible from cmd
  • navigate to directory that contains multiple flutter projects

Notes:

@GAM3RG33K
GAM3RG33K / pagination_view.dart
Created November 18, 2021 09:50
Pagination View implementation for Big data source
import 'package:flutter/material.dart';
class PaginationView extends StatefulWidget {
final int maxCountPerPage;
final int totalCount;
final Widget Function(BuildContext context, int start, int end) builder;
final VoidCallback? onNext;
final VoidCallback? onPrevious;
@GAM3RG33K
GAM3RG33K / demo.js
Created October 28, 2021 10:33
Conditional number formatting in Javascript
function conditionalFormatting(value) {
var input = Math.abs(value)
var formatLegth = 2;
if(input == 0) {
formatLegth = 2;
} else if(input > 0 && input <= 1) {
formatLegth = 4;
} else if(input > 1 && input <= 10) {
formatLegth = 3;
@GAM3RG33K
GAM3RG33K / main.dart
Created August 20, 2021 08:51
[UI - Hack] Circular loading of an image
import 'dart:async';
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
@GAM3RG33K
GAM3RG33K / PermissionUtils.java
Created June 16, 2021 04:29 — forked from tatocaster/PermissionUtils.java
Utility class for access to runtime permissions.
/**
* Utility class for access to runtime permissions.
*/
public abstract class PermissionUtils {
/**
* Requests the fine location permission. If a rationale with an additional explanation should
* be shown to the user, displays a dialog that triggers the request.
*/
public static void requestPermission(AppCompatActivity activity, int requestId,
@GAM3RG33K
GAM3RG33K / codemagic.yaml
Created May 28, 2021 14:42
Codemagic configuration file for iOS
workflows:
ios-workflow:
name: iOS Workflow
max_build_duration: 30
environment:
vars:
XCODE_WORKSPACE: "Runner.xcworkspace"
XCODE_SCHEME: "Runner"
# https://docs.codemagic.io/code-signing-yaml/signing-ios/
# Put your bundle id here