Skip to content

Instantly share code, notes, and snippets.

@AmrMekkawy
AmrMekkawy / timezones-per-country.json
Created May 1, 2024 14:20 — forked from riamaria/timezones-per-country.json
JSON of Timezone Names per Alpha 2 Country Code + ALL
{"ALL":["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","Amer
@AmrMekkawy
AmrMekkawy / DTFromID.java
Created November 15, 2021 13:27 — forked from Zelakolase/DTFromID.java
National ID to get data from
import java.util.HashMap;
public class DTFromID {
static HashMap<String, String> GovIDMap = new HashMap<String, String>(){
{
put("01","Cairo"); put("02","Alexandria"); put("03","Portsaid"); put("04","Suez"); put("11","Damietta"); put("12","Daqahlia"); put("13","Sharkia"); put("14","Qalyobia"); put("15","Kafr El-sheikh");
put("16","Gharbia"); put("17","Monufia"); put("18","Beheira"); put("19","Ismailia"); put("21","Giza"); put("22","Bani Suef"); put("23","Fayum"); put("24","Menya"); put("25","Asuit");
put("27","Qena"); put("28","Aswan"); put("29","Luxor"); put("31","Red Sea"); put("32","Alwady Algaded"); put("33","Matrouh"); put("34","North Sinai"); put("35","South Sinai"); put("88","N/A");
}
};
@AmrMekkawy
AmrMekkawy / pivot-tables.md
Created October 29, 2020 10:18 — forked from Braunson/pivot-tables.md
Laravel 8.x - Diving into Pivot Tables

Laravel 6 - Diving Into Pivot Tables

Pivot tables can be confusing and a little hard to wrap your head around at first. In this quick article we are going to dive into what a pivot table is, how to create one and finally how to use the pivot table. Let's dive in!

What is a pivot table?

A pivot table is used to connect relationships between two tables. Laravel provides a Many To Many relationship where you can use a pivot table.

@AmrMekkawy
AmrMekkawy / deployment_guide.md
Created April 24, 2020 14:34 — forked from vicgonvt/deployment_guide.md
Deployment Guide for Ubuntu Server from Scratch with Laravel
@AmrMekkawy
AmrMekkawy / connectAndPrint.js
Created December 11, 2018 10:29 — forked from tresf/connectAndPrint.js
Connect and print
function connectAndPrint() {
// our promise chain
connect().then(function() {
return print();
}).then(function() {
success(); // exceptions get thrown all the way up the stack
}).catch(fail); // so one catch is often enough for all promises
// NOTE: If a function returns a promise, you don't need to wrap it in a fuction call.
// The following is perfectly valid:
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromPromise';
import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/map';
declare var qz: any;
@AmrMekkawy
AmrMekkawy / rules-to-write-better-commit-messages.md
Created September 5, 2018 11:20 — forked from medhatdawoud/rules-to-write-better-commit-messages.md
This gist is the summary of a video on YouTube [in Arabic] you can watch from here: https://youtu.be/BTlL-LBDCSI

Rules to write a better commit message

These are my preferences for a good commit message, feel free to fork this gist and add your own standards, or add comment here to share yours with the community.

1. Include only the files related to the feature you are implementing:

  • Don't add any file that is not related to the main issue, you can make it in a separate commit.
  • Separating files that not related is important in the revert cases.
  • Revise the whole changes always before committing and make sure to mention each change you made in the message.

2. Commit subject should be concise and reflect the essence of the commit:

  • Imagine the commit as an Email to the owner or your team mates.
  • Subject in the first and main sentence of the commit, it should be concise and to the point.
  • It shouldn't exceed 50 char.

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine
@AmrMekkawy
AmrMekkawy / bootsrap_class_list
Created July 29, 2017 12:29 — forked from geksilla/bootsrap_class_list
Bootstrap css class list
.navbar
.caret
.label
.table
.img-responsive
.img-rounded
.img-thumbnail
.img-circle
.sr-only
.lead
@AmrMekkawy
AmrMekkawy / API.md
Created June 19, 2017 16:03 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: