Skip to content

Instantly share code, notes, and snippets.

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

El Hadj Babacar Cissé ehbc221

🏠
Working from home
  • Sonatel SA
  • Dakar, Sénégal
  • X @ehbc221
View GitHub Profile
@ehbc221
ehbc221 / wagner-fischer.java
Created February 21, 2024 09:50
Wagner Fischer algorithm for spell checkers / autocorrects
// Credits : @b001io on github
// Repo link : https://github.com/b001io/wagner-fischer/blob/main/wagner_fischer.py
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Main {
@ehbc221
ehbc221 / FLUTTER_DEEPLINK_CONFIG.md
Created February 12, 2024 22:10
Flutter Deeplinks Configuration
@ehbc221
ehbc221 / spring-boot-scripts.sh
Created December 29, 2023 16:54
Spring Boot Scripts
######################################## Run jar in Backend ########################################
nohup java -jar expenza-0.0.1-SNAPSHOT.jar &
@ehbc221
ehbc221 / analysis_options.dart
Created June 24, 2023 00:21
Flutter Linting - Linter analysis_options
include: package:flutter_lints/flutter.yaml
analyzer:
errors:
dead_code: info
invalid_assignment: warning
missing_required_param: error
missing_return: error
must_be_immutable: error
exclude:
@ehbc221
ehbc221 / flutter-scripts.sh
Last active December 29, 2023 16:55
Flutter scripts for run, build, watch, rename and clean
######################################## Run Flutter ########################################
flutter run
######################################## Run the flutter build runner ########################################
flutter pub run build_runner build --delete-conflicting-outputs
######################################## Watch changes in packages the flutter build runner ########################################
flutter packages pub run build_runner watch --delete-conflicting-outputs
######################################## Sign APK (from project root) ########################################
@ehbc221
ehbc221 / rename.sh
Created June 23, 2023 13:11
Rename files containing substring recursively with shell and rnr
rnr -f -r 'old_name' 'new_name' *
@ehbc221
ehbc221 / bool.filter.dart
Last active June 8, 2023 16:56
A series of useful filters to handle searching via APIs in Flutter. Inspired from Spring boot backend ones.
import 'package:equatable/equatable.dart';
import 'package:expenza/domain/models/type/json_map.type.dart';
import 'package:expenza/mixins/to_json_field.mixin.dart';
import 'package:expenza/network/service/filter/filter.dart';
/// Filter a [bool].
///
/// - author - @ehbc221
/// - version - 1.0.0
/// - last updated - June 8th, 2023
@ehbc221
ehbc221 / jwt.interceptor.dart
Last active June 8, 2023 16:54
An interceptor for JWTs in Flutter, using dio and shared_preferences libraries. Handles retrieving the JWT in shared_preferences (when exists) and adding it to the request
import 'package:dio/dio.dart';
import 'package:expenza/config/injectable.dart';
import 'package:expenza/domain/user_preferences.dart';
import 'package:expenza/utils/log.utils.dart';
const String _tag = 'JwtInterceptor';
/// Jwt Interceptor.
///
/// This class provides the Jwt from the user's session to the request's header
@ehbc221
ehbc221 / base.repository.dart
Last active June 8, 2023 16:54
A wrapper for all your repositories in Flutter. Used to parse responses from your datasources (remote; ie: API / local; ie: SqfLite) with a unified Resource class, making it easy to have the same logic throughout your application UIs.
import 'dart:async';
import 'package:expenza/constants/global.constants.dart';
import 'package:expenza/domain/resource.dart';
import 'package:expenza/utils/log.utils.dart';
const String _tag = 'BaseRepository';
/// Base Repository that wraps all the app's repositories.
///
@ehbc221
ehbc221 / base.datasource.dart
Last active June 8, 2023 16:54
A wrapper around all your datasources (ie: API) in Flutter with the dio package. Responsible for calling the APIs and handling the response / errors parsing, and avoid redundancy.
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:expenza/constants/global.constants.dart';
import 'package:expenza/domain/resource.dart';
import 'package:expenza/network/dto/base.dto.dart';
import 'package:expenza/utils/log.utils.dart';
import 'package:expenza/utils/pagination.utils.dart';
import 'package:retrofit/dio.dart';