Skip to content

Instantly share code, notes, and snippets.

View AzizaHelmy's full-sized avatar

Aziza Helmy AzizaHelmy

  • Etisalat Egypt
  • Egypt
View GitHub Profile
@abd3lraouf
abd3lraouf / KeyboardVisibilityDetector.kt
Last active February 19, 2024 14:15
Android Compose Keyboard Visibility Detector: A Jetpack Compose implementation to detect the visibility of the software keyboard in an Android app. This example demonstrates the use of WindowInsets and isImeVisible in a simple Compose layout
package dev.abd3lraouf.learn.myapplication
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
@bmc08gt
bmc08gt / 1_Screen.kt
Last active December 6, 2023 17:45
FKScaffold with accessory view triggers
FKScaffold(
modifier = Modifier.fillMaxSize(),
topBar = {
FKLargeTopAppBar(title = name)
},
) { padding, triggerAccessoryView ->
ItemForm(
modifier = Modifier.padding(top = padding.calculateTopPadding()),
state = state,
dispatch = viewModel::dispatchEvent
@chatton
chatton / SendObjectsOverSockets.java
Created September 26, 2017 15:27
Example of how to send an Object over a Socket in Java.
import java.io.Serializable;
// must implement Serializable in order to be sent
public class Message implements Serializable{
private final String text;
public Message(String text) {
this.text = text;
}
@wojteklu
wojteklu / clean_code.md
Last active April 27, 2024 19:52
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@subfuzion
subfuzion / curl.md
Last active April 27, 2024 20:56
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@udacityandroid
udacityandroid / MainActivity.java
Last active November 22, 2022 21:34
Android for Beginners : Cookies Starting Code
package com.example.android.cookies;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@Override
@dodyg
dodyg / gist:5823184
Last active March 29, 2024 03:59
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@dodyg
dodyg / gist:5616605
Last active November 21, 2022 03:05
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")