Skip to content

Instantly share code, notes, and snippets.

View ahmedeltaher's full-sized avatar
💻
Pro

ahmed.mohamed ahmedeltaher

💻
Pro
  • SAP SE
  • Berlin
View GitHub Profile
@ahmedeltaher
ahmedeltaher / .gitlab-ci.yml
Created January 9, 2019 23:11 — forked from illuzor/.gitlab-ci.yml
Config for gitlab ci android with unit tests and instrumented tests
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.3"
SDK_TOOLS: "4333796" # from https://developer.android.com/studio/#command-tools
EMULATOR_VERSION: "22" # Unable to install with newer emulator versions. Don`t know why.
before_script:
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${SDK_TOOLS}.zip
Description Git Command
Clone an existing repository git clone "your URL"
Create a new local repository git init
Changed files in your working directory git status
Changes to tracked files git diff
Add all current changes to the next commit git add
Add some chang
@ahmedeltaher
ahmedeltaher / Azan_Supported_Methods.md
Last active February 1, 2020 12:17
Azan Supported Methods
Method Name Fajr Angel Isha Angel
Umm al-Qura University, Makkah 18.5 90 min after Maghrib , 120 min during Ramadan
MUHAMMADIYAH 20 18
Muslim World League (MWL) 18 17
Egyptian General Authority of Survey 19.5 17.5
University of Islamic Sciences, Karachi 18 18
Islamic Society of North America (ISNA) 15 15
@ahmedeltaher
ahmedeltaher / System Design.md
Created January 18, 2020 17:56 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
Horizontal Scaling Vertical Scaling
Load blancer Required N/A
Single point of failure resilient Yes, Suffering of a single point of failure
Communication Network-Calls (RPC) Internal process communication
Data Consistency No Yes
Scaling Scales well as users increasing HardWare limit
[
{
"calories": "516 kcal",
"carbos": "47 g",
"description": "There\u2019s nothing like the simple things in life - the smell of freshly cut grass, sitting outside on a nice sunny day, spending time with friends and family. Well here is a recipe that delivers simple culinary pleasures - some nice fresh fish with a crispy crust, crunchy potato wedges and some delightfully sweet sugar snap peas flavoured with cooling mint. Slip into something comfortable and relax into a delicious dinner!",
"difficulty": 0,
"fats": "8 g",
"headline": "with Sweet Potato Wedges and Minted Snap Peas",
"id": "533143aaff604d567f8b4571",
"image": "https://img.hellofresh.com/f_auto,q_auto/hellofresh_s3/image/533143aaff604d567f8b4571.jpg",
Core Elements in Paging library:
  • PagedList.
  • Data source.
PagedList:
  • collection.
  • loads data in pages.
  • Asynchronous data loading.
DataSource:

Interview Questions

Kotlin

Q1: What is a primary constructor in Kotlin? ☆☆

Answer: The primary constructor is part of the class header. Unlike Java, you don't need to declare a constructor in the body of the class. Here's an example:

Interview Questions

Kotlin

Q1: What is a primary constructor in Kotlin? ☆☆

Answer: The primary constructor is part of the class header. Unlike Java, you don't need to declare a constructor in the body of the class. Here's an example:

@ahmedeltaher
ahmedeltaher / detekt-pre-commit
Last active November 26, 2021 16:38
Android Git Hooks
echo "Running detekt check..."
OUTPUT="/tmp/detekt-$(date +%s)"
./gradlew detekt > $OUTPUT
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
cat $OUTPUT
rm $OUTPUT
echo "***********************************************"
echo " Detekt failed "
echo " Please fix the above issues before committing "