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
videoName = (DocumentFile.fromSingleUri(applicationContext, videoUri)?.name ?: "").split('.')[0]
@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) {
GlobalScope.launch {
viewModel.saveDataToDatabase(requireActivity(), account)
GlobalScope.launch(Dispatchers.Main) {
Toast.makeText(requireActivity(), "Data Inserted successfully", Toast.LENGTH_LONG).show()
}
}
public void selectImage() {
Intent pickIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
pickIntent.setType("image/*");
startActivityForResult(pickIntent, 411);
}
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
FOr eample to choose or aelect only bmp files, use
Intent i = new Intent(Intent.ACTION_OPEN_DOCUMENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/x-ms-bmp");
startActivityForResult(i, 411);
@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;
NavHostFragment.findNavController(ZoomerFragment.this).navigate(R.id.action_SecondFragment_to_FirstFragment);
Navigation.findNavController(getView()).navigate(R.id.action_SecondFragment_to_FirstFragment);