Skip to content

Instantly share code, notes, and snippets.

@Abdallah-Abdelazim
Abdallah-Abdelazim / HttpsEverywhereInterceptor.java
Last active May 9, 2021 13:44
HttpsEverywhereInterceptor: An OkHttp interceptor to replace any HTTP scheme with HTTPS for outgoing network requests.
package com.example.network;
import androidx.annotation.NonNull;
import java.io.IOException;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
@Abdallah-Abdelazim
Abdallah-Abdelazim / #android_filterable_example.md
Last active May 5, 2023 21:45 — forked from DeepakRattan/Bean.java
Filtering ListView using Filterable interface

Android Filterable Example:

This is an example of using Filterable with a SearchView to filter the data of a ListView adapter.

@Abdallah-Abdelazim
Abdallah-Abdelazim / AutoClearedValue.kt
Created February 12, 2022 22:11
AutoClearedValue: A lazy property that gets cleaned up when the fragment's view is destroyed.
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Abdallah-Abdelazim
Abdallah-Abdelazim / linux_start_app_minimized_script.md
Last active March 10, 2022 22:04
Linux Bash script to start an application minimized (useful for autostart minimized on login)

To start an application minimized (like the Todoist snap as in below), create a script similar to the following.
You can add the script to autostart on login in your DE.

#!/bin/bash
# Launch Todoist as a background process
/var/lib/snapd/desktop/applications/todoist_todoist.desktop&
# Loop, waiting for the window to initialise
i=0
while [ $i -lt 20 ]
@Abdallah-Abdelazim
Abdallah-Abdelazim / UiText.kt
Last active September 3, 2023 13:03
UiText: use Android's String Resources in the whole project.
package com.example.app
import android.content.Context
import androidx.annotation.StringRes
sealed class UiText {
data class DynamicString(val value: String) : UiText()
data class StringResource(
@Abdallah-Abdelazim
Abdallah-Abdelazim / multiple_ssh_setting.md
Created February 18, 2023 23:56 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"