Skip to content

Instantly share code, notes, and snippets.

View oluwabajio's full-sized avatar

Ismail Osunlana oluwabajio

  • Tingtel
  • lagos
View GitHub Profile
@oluwabajio
oluwabajio / remove-bitly-links.php
Created March 13, 2023 03:20 — forked from kremalicious/remove-bitly-links.php
WordPress plugin to remove all bit.ly links from post content, keeping the anchor text
@oluwabajio
oluwabajio / make-dvd.md
Created October 27, 2022 21:51 — forked from mikitsu/make-dvd.md
How to create a Video DVD with menus using dvdauthor and ffmpeg

Make DVD Videos with dvdauthor and FFmpeg

Preparation

Prepare the videos by converting them with ffmpeg

ffmpeg -i 'some input file.mp4' -target [pal-dvd or ntsc-dvd] output.mpg
@oluwabajio
oluwabajio / php_form_submit.md
Created April 26, 2022 00:35 — forked from jesperorb/php_form_submit.md
PHP form submitting with fetch + async/await

PHP Form submitting

If we have the following structure in our application:

  • 📁 application_folder_name
    • 📄 index.php
    • 📄 handle_form.php
    • 📄 main.js

And we fill our index.php with the following content just to get a basic website with a form working. You should be able to run this through a php-server of your choice.

@oluwabajio
oluwabajio / MediaDecoder.java
Created February 15, 2022 09:45 — forked from a-m-s/MediaDecoder.java
Android code to extract raw audio from arbitrary media files.
/* MediaDecoder
Author: Andrew Stubbs (based on some examples from the docs)
This class opens a file, reads the first audio channel it finds, and returns raw audio data.
Usage:
MediaDecoder decoder = new MediaDecoder("myfile.m4a");
short[] data;
while ((data = decoder.readShortData()) != null) {
@oluwabajio
oluwabajio / VideoUtils.java
Created August 31, 2021 13:19 — forked from ArsalRaza/VideoUtils.java
Extract Audio from Video, Mute Video, Crop Video from start, Crop Video from end Android MediaMuxer - JAVA
import android.annotation.SuppressLint;
import android.media.MediaCodec;
import android.media.MediaExtractor;
import android.media.MediaFormat;
import android.media.MediaMetadataRetriever;
import android.media.MediaMuxer;
import android.util.Log;
import java.io.IOException;
import java.nio.ByteBuffer;
@oluwabajio
oluwabajio / RealPathUtil.kt
Created April 4, 2021 18:27 — forked from MeNiks/RealPathUtil.kt
Kotlin code to get real path / sd card path from intent data while browsing file.
import android.annotation.SuppressLint
import android.content.ContentUris
import android.content.Context
import android.content.CursorLoader
import android.database.Cursor
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.DocumentsContract
import android.provider.MediaStore
@oluwabajio
oluwabajio / PathUtils.java
Created January 12, 2020 13:04 — forked from pratikbutani/PathUtils.java
Get Path from URI or URI from Path Utils.
public class PathUtils {
/**
* To get URI from Path
*
* @param context context
* @param file file
* @return Uri
*/
public static Uri getUriFromPath(Context context, File file) {
String filePath = file.getAbsolutePath();