Skip to content

Instantly share code, notes, and snippets.

Working from home

Mahmoud Mabrok Fouad MahmoudMabrok

Working from home
View GitHub Profile
jonikarppinen /
Last active Nov 23, 2022
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).

bennylope /
Created Apr 22, 2016 — forked from webkader/
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.

balzss /
Last active Oct 30, 2022
Utility library for RSA cryptography on Android
import android.util.Base64;
import java.nio.charset.StandardCharsets;
radoyankov / Example.kt
Last active Jul 28, 2022
Easy Spannable on Kotlin
View Example.kt
val spanned = spannable{ bold("some") + italic(" formatted") + color(Color.RED, " text") }
val nested = spannable{ bold(italic("nested ")) + url("", "text") }
val noWrapping = bold("no ") + sub("wrapping ) + sup("also ") + "works"
text_view.text = spanned + nested + noWrapping
gilbertwat /
Created Jan 25, 2013
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.content.Context;
import android.os.Build;
import android.widget.DatePicker;
devrath / ExpandableListView Using
Created Sep 28, 2015
ExpandableListView using recyclerview. That also can have multiple adapters based on groups
View ExpandableListView Using |
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;