Skip to content

Instantly share code, notes, and snippets.

View mohamed-samir907's full-sized avatar
🏠
Working from home

Mohamed Samir mohamed-samir907

🏠
Working from home
View GitHub Profile
@mohamed-samir907
mohamed-samir907 / folder_structure.md
Created January 5, 2025 20:04 — forked from ayoubzulfiqar/folder_structure.md
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@mohamed-samir907
mohamed-samir907 / service-monitor.sh
Created November 2, 2021 23:35
service monitoring bash script
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Error: Invlaid number of arguments. expection 1 argument"
exit
fi
# Check the service status
# [ + ] (running)
# [ - ] (stopped)
#!/bin/bash
# Ask for the php version to use it
echo "Which php version you want to user?"
read version
# Use the provided version of php
@mohamed-samir907
mohamed-samir907 / LazyGeneratorCollection.php
Created October 14, 2020 23:01 — forked from andrerom/LazyGeneratorCollection.php
Lazy Collection using Generator in PHP (Example, script in bottom of file to test it)
<?php
/**
* Class GeneratorCollection, allows for lazy loaded arrays using Generators withouth it's limitations.
*
* This collection class takes Generator as argument, and allows user to threat it like any kind of array. It will take
* care about storing the values returned from generator so user can iterate over it several times.
*
* NOTE: In current form only works with generators that uses integers as keys (lists).
*/
@mohamed-samir907
mohamed-samir907 / LazyGeneratorCollection.php
Created October 14, 2020 23:01 — forked from andrerom/LazyGeneratorCollection.php
Lazy Collection using Generator in PHP (Example, script in bottom of file to test it)
<?php
/**
* Class GeneratorCollection, allows for lazy loaded arrays using Generators withouth it's limitations.
*
* This collection class takes Generator as argument, and allows user to threat it like any kind of array. It will take
* care about storing the values returned from generator so user can iterate over it several times.
*
* NOTE: In current form only works with generators that uses integers as keys (lists).
*/
@mohamed-samir907
mohamed-samir907 / local_notifications.dart
Created August 1, 2020 22:42
Flutter local notifications with alarm manager
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
FlutterLocalNotificationsPlugin localNotificationsPlugin = FlutterLocalNotificationsPlugin();
void initNotifications () async {
var initializeAndroid = AndroidInitializationSettings('@mipmap/ic_launcher');
var initializeIOS = IOSInitializationSettings();
var initializationSettings = InitializationSettings(initializeAndroid, initializeIOS);
await localNotificationsPlugin.initialize(initializationSettings);

User Authentication

The Base Host URL is http://BASE_URL/api add thes url before the follwinf urls in the API.

  1. User Login

Method:   POST
Url:   /oauth/login
Param:   email, password
Success: