Skip to content

Instantly share code, notes, and snippets.

:octocat:
coding...

mohamedelagamy mohamedagamy

:octocat:
coding...
View GitHub Profile
@mohamedagamy
mohamedagamy / KeyboardEditText
Created Sep 12, 2019
prevent keyboard disappear
View KeyboardEditText
//The goal is to make a custom lock screen that the user must enter a pass code
//or leave the application.
//When the user taps the "keyboard down" button the keyboard does not disappear.
//https://stackoverflow.com/questions/13591012/implementing-onkeypreimeint-keycode-keyevent-event-in-fragment
public class CustomKonashaEditText extends AppCompatEditText {
public CustomKonashaEditText(Context context, AttributeSet attrs) {
super(context, attrs);
}
View CustomEditText.java
import android.content.Context;
import android.content.res.TypedArray;
import android.text.method.PasswordTransformationMethod;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
View clean code
https://blog.testlodge.com/what-is-bdd/
https://prezi.com/5lw2osodzhqj/tdd-vs-bdd-vs-ddd/
https://qr.ae/TWrej6
https://stackoverflow.com/questions/184618/
========================================================
https://qr.ae/TWreQR
Get your mind right.
takes practice and study, over many years
The key is deliberative practice: not just doing it again and again, but challenging yourself with a task that is just beyond your current ability, trying it,
View ImageLoadingBugSolver.java
//https://stackoverflow.com/questions/39374227/how-to-load-all-the-images-in-the-background-of-a-recyclerview-in-android
public class PreCachingLayoutManager extends LinearLayoutManager {
private static final int DEFAULT_EXTRA_LAYOUT_SPACE = 600;
private int extraLayoutSpace = -1;
private Context context;
public PreCachingLayoutManager(Context context) {
super(context);
this.context = context;
@mohamedagamy
mohamedagamy / installing-postman.md
Created Jan 30, 2019 — forked from invinciblycool/installing-postman.md
Installing Postman on Ubuntu/Gnome
View installing-postman.md

Since Chrome apps are now being depracated. Download postman from https://dl.pstmn.io/download/latest/linux

Installing Postman

tar -xzf Postman-linux-x64-5.3.2.tar.gz

If any version is installed before, remove it.

sudo rm -rf /opt/Postman
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application android:label="@string/app_name">
@mohamedagamy
mohamedagamy / OpenWithSublimeText3.bat
Created Aug 27, 2016 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
View OpenWithSublimeText3.bat
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@mohamedagamy
mohamedagamy / Method 1
Created Aug 13, 2016 — forked from udacityandroid/Method 1
Android Development for Beginners : Define a Method
View Method 1
private String createCalendarEventReminder(String eventName, String location, int minutesAway) {
String reminder = "You have an upcoming event in " + minutesAway + " minutes.";
reminder = reminder + " It is " + eventName + " held at " + location + ".";
return reminder;
}
@mohamedagamy
mohamedagamy / Option A
Created Aug 13, 2016 — forked from udacityandroid/Option A
Android Development for Beginners : Calculate the Price Method
View Option A
/**
* Calculates the price of the order based on the current quantity.
*
* @return the price
*/
private int calculate price(int quantity {
int price = quantity * 5;
return price;
}
You can’t perform that action at this time.