Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Mahmoud Mabrok Fouad MahmoudMabrok

🏠
Working from home
View GitHub Profile
@radoyankov
radoyankov / Example.kt
Last active Nov 24, 2021
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("www.google.com", "text") }
val noWrapping = bold("no ") + sub("wrapping ) + sup("also ") + "works"
text_view.text = spanned + nested + noWrapping
@balzss
balzss / CryptoUtil.java
Last active Nov 27, 2021
Utility library for RSA cryptography on Android
View CryptoUtil.java
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;
@bennylope
bennylope / ffmpeg-watermark.md
Created Apr 22, 2016 — forked from webkader/ffmpeg-watermark.md
FFmpeg add a watermark to video
View ffmpeg-watermark.md

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.

@jonikarppinen
jonikarppinen / 1_RxJava-connectivity-status-example.md
Last active Sep 11, 2020
Example of listening to connectivity status in Android and reacting to going offline. (Subscription, Observable, Observer, PublishSubject are from RxJava.)
View 1_RxJava-connectivity-status-example.md

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).

@devrath
devrath / ExpandableListView Using RecyclerView.java
Created Sep 28, 2015
ExpandableListView using recyclerview. That also can have multiple adapters based on groups
View ExpandableListView Using RecyclerView.java
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;
@gilbertwat
gilbertwat / AppLocaleDatePickerDialog.java
Created Jan 25, 2013
DatePickerDialog that honors the locale set by the app
View AppLocaleDatePickerDialog.java
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;