Skip to content

Instantly share code, notes, and snippets.

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

Gauthier Eholoum gausoft

🏠
Working from home
View GitHub Profile
@gausoft
gausoft / TgPhoneNumbersFormat.md
Last active May 9, 2021 12:39
Regex for Togolese phone numbers format verification

With/Without country code format

 ^((00228|\+228)\s?)+((2[2-7]|9[6-9]|70|79|9[0-3])\s?)\d{2}(\s?)\d{2}(\s?)\d{2}$

Explanation :

Correct examples : 00228 98615284, +22898615284, +228 70695423, 00228 99 86 56 38

@gausoft
gausoft / Togo regex phone number.md
Last active February 24, 2022 08:15
Check if phone numbers without country code is a kind of Togolese phone numbers [Must be improved]

All supported phone numbers

 ^(2[2-7]|9[6-9]|70|79|9[0-3])\d{6}$

Explanation :

Correct examples : 22695482, 98615284, 92612381, etc.

Only TogoCom's Carrier phone numbers

@gausoft
gausoft / multiple-files-remove-prefix.md
Created March 23, 2021 09:28
Remove prefix from multiple files in Linux console

Bash

for file in prefix*; do mv "$file" "${file#prefix}"; done;

The for loop iterates over all files with the prefix. The do removes from all those files iterated over the prefix.

Here is an example to remove "bla_" form the following files:

bla_1.txt
bla_2.txt

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@gausoft
gausoft / split_bar.dart
Created October 4, 2020 19:04 — forked from slightfoot/split_bar.dart
Split Bar in Flutter. Lets you touch between two horizontal sections to resize the split point.
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(
primaryColor: Colors.indigo,
accentColor: Colors.pinkAccent,
),
@gausoft
gausoft / jwt-payload-parse.dart
Created August 26, 2020 07:01 — forked from hjJunior/jwt-payload-parse.dart
Get payload of JWT token in Dart language
import 'dart:convert';
Map<String, dynamic> parseJwt(String token) {
final parts = token.split('.');
if (parts.length != 3) {
throw Exception('invalid token');
}
final payload = _decodeBase64(parts[1]);
final payloadMap = json.decode(payload);
@gausoft
gausoft / Flutter Local_Auth Setting for Android (MainActivity.kt) #kotlin.md
Created August 21, 2020 20:16 — forked from akifarhan/localAuthSettingsForAndroid_kotlin.md
Flutter Local_Auth Setting for Android (MainActivity.kt) #kotlin

Note that local_auth plugin requires the use of a FragmentActivity as opposed to Activity. This can be easily done by switching to use FlutterFragmentActivity as opposed to FlutterActivity in your manifest (or your own Activity class if you are extending the base class).

1. Open android>app>src>main>AndroidManifest.xml

Add USE_FINGERPRINT permission.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.[your.package]">
  <uses-permission android:name="android.permission.USE_BIOMETRIC"/>
  <application...
@gausoft
gausoft / README.md
Created August 15, 2020 07:45 — forked from CodingDoug/README.md
Patterns for security with Firebase Authentication: offload work to Cloud Functions

This is the runnable sample code from the blog post [Patterns for security with Firebase Authentication: offload work to Cloud Functions][1]. It discusses offloading work from a client app to Cloud Functions using an authentication trigger.

  1. Create a new Firebase project
  2. Enable email/password authentication
  3. Provision Cloud Firestore and apply the rules given in this gist
  4. Use the Firebase CLI to create a workspace for Functions using TypeScript
  5. Deploy the given HTML and JavaScript to Firebase Hosting (the CLI emulator will also work).
  6. Deploy the function code to Cloud Functions using the Firebase CLI
@gausoft
gausoft / Fancy Button - Flutter
Created June 30, 2020 08:37 — forked from mkiisoft/Fancy Button - Flutter
Fancy Button made for Flutter Games and Apps
import 'package:flutter/material.dart';
class FancyButton extends StatefulWidget {
const FancyButton({
Key key,
@required this.child,
@required this.size,
@required this.color,
this.duration = const Duration(milliseconds: 160),
this.onPressed,