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 / resource.dart
Last active June 8, 2023 16:55
A wrapper class for uniform data requesting (API / local database) for Flutter. Handles loading, success, and error data mapping.
import 'package:expenza/domain/models/type/json_map.type.dart';
import 'package:expenza/network/dto/pagintor.dto.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';
part 'resource.g.dart';
/// The types of status used for the api/database calls responses.
///
/// - author - @ehbc221
@ehbc221
ehbc221 / app.config.dart
Last active June 8, 2023 16:55
A configuration file for your Flutter environments
import 'dart:io';
import 'package:expenza/config/injectable.dart';
import 'package:expenza/config/my_http_overrides.dart';
import 'package:expenza/constants/api.constants.dart';
const String baseUrlKey = 'baseUrl';
const String environmentKey = 'ENVIRONMENT';
/// The application's environments.
@ehbc221
ehbc221 / criteria.mixin.dart
Last active June 8, 2023 16:53
A mixin for handling filtering criteria in Flutter
/// Wrapper for all the criterias.
///
/// - author - @ehbc221
/// - version - 1.0.0
/// - last updated - June 8th, 2023
mixin Criteria {
Criteria copy();
/// The search page.
abstract final int? page;
@ehbc221
ehbc221 / create-and-publish-npm-package.MD
Created October 27, 2022 17:21
Create and publish a npm package

Create and publish a npm package

How to create and configure your own npm repository

Let's take example as our new project name:

  1. Create and open the directory

    mkdir example
    

cd example

@ehbc221
ehbc221 / iterm2-solarized.md
Created September 22, 2022 15:54 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ehbc221
ehbc221 / jhipster-json-folder-to-dot-notation.py
Last active June 23, 2022 09:22
Convert Jhipster translations to dot annotation (for Wieldy React Admin Template)
from getopt import getopt, GetoptError
from json import load, loads, dumps
from os import listdir, SEEK_END
from os.path import isfile, isdir, join
from sys import argv, exit, stdout
# Query Yes or No to the user
def query_yes_no(question, default="yes"):
"""Ask a yes/no question via raw_input() and return their answer.
@ehbc221
ehbc221 / switch-docker-daemon.sh
Created May 24, 2021 19:04
Switch Docker Daemon
cd C:\Program Files\Docker\Docker
DockerCli.exe -SwitchDaemon
@ehbc221
ehbc221 / jhipster-json-to-dot-notation.py
Last active June 23, 2022 09:22
Json to Dot Notation for Jhipster translations
import getopt
import json
import os
import sys
import pyperclip
def get_input_string_from_clipboard():
input_string = json.loads(pyperclip.paste())
@ehbc221
ehbc221 / IntelIJTrialReset.bat
Created May 15, 2021 18:36
Reset Jetbrains Tools trials
:: Intellij IDEA
cd "C:%HOMEPATH%\AppData\Roaming\JetBrains\IntelliJIdea20*"
rmdir "eval" /s /q
del "options\other.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f
:: PhpStorm
cd "C:%HOMEPATH%\AppData\Roaming\JetBrains\PhpStorm20*"
rmdir "eval" /s /q
del "options\other.xml"
package com.example.network
import android.util.Log
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import com.example.utils.ErrorUtils
/**
* Extension for awaitResponse