Skip to content

Instantly share code, notes, and snippets.

View MahmoudMabrok's full-sized avatar
🏠
Working from home

Mahmoud Mabrok Fouad MahmoudMabrok

🏠
Working from home
View GitHub Profile
@bennylope
bennylope / ffmpeg-watermark.md
Created April 22, 2016 23:17 — forked from webkader/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

@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
@radoyankov
radoyankov / Example.kt
Last active January 27, 2023 08:59
Easy Spannable on Kotlin
val spanned = spannable{ bold("some") + italic(" formatted") + color(Color.RED, " text") }
val nested = spannable{ bold(italic("nested ")) + url("www.google.com", "text") }
val noWrapping = bold("no ") + sub("wrapping ) + sup("also ") + "works"
text_view.text = spanned + nested + noWrapping
@jonikarppinen
jonikarppinen / 1_RxJava-connectivity-status-example.md
Last active November 23, 2022 18:16
Example of listening to connectivity status in Android and reacting to going offline. (Subscription, Observable, Observer, PublishSubject are from RxJava.)

Example of using RxJava to listen to connectivity status in Android

You could use the same approach to listen to any status, but this example includes network connectivity specifics too (ConnectionChangeReceiver and AndroidUtils.isConnected).

@balzss
balzss / CryptoUtil.java
Last active October 30, 2022 05:23
Utility library for RSA cryptography on Android
import android.util.Base64;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
@gilbertwat
gilbertwat / AppLocaleDatePickerDialog.java
Created January 25, 2013 03:40
DatePickerDialog that honors the locale set by the app
package com.gilbert.wat.widget;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Calendar;
import android.app.DatePickerDialog;
import android.content.Context;
import android.os.Build;
import android.widget.DatePicker;
@devrath
devrath / ExpandableListView Using RecyclerView.java
Created September 28, 2015 05:50
ExpandableListView using recyclerview. That also can have multiple adapters based on groups
ExpandableListAdapter.java |
---------------------------------------
import android.content.Context;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;