Skip to content

Instantly share code, notes, and snippets.

View oluwabajio's full-sized avatar

Ismail Osunlana oluwabajio

  • Tingtel
  • lagos
View GitHub Profile
@jonbrockett
jonbrockett / functions.php
Created June 10, 2021 14:10
Disable Searching for an Empty String in WordPress Search
/** Show 'Nothing Found' for an empty search instead of all posts/pages (Helps with Accessibility) */
require_once 'library/search-empty-disable.php';
@NitinPraksash9911
NitinPraksash9911 / UnzipUtils.kt
Last active October 17, 2024 13:46
Unzipping file in android/kotlin
import java.io.*
import java.util.zip.ZipFile
/**
* UnzipUtils class extracts files and sub-directories of a standard zip file to
* a destination directory.
*
*/
object UnzipUtils {
@Ajinx1
Ajinx1 / state.php
Created January 6, 2021 16:24
Nigeria states and LGA automatically with html select
<?php
<div class="form-group has-feedback" id="state1">
<div class="form-group input-group has-feedback">
<select class="form-control" name="state" id="state" placeholder="Pick State" onchange="show(this)">
</select>
<span class="input-group-addon"><i class="fa fa-map"></i></span>
</div>
<span class="help-block" id="helpstate"></span>
</div>
@pratikbutani
pratikbutani / PathUtils.java
Created September 9, 2019 05:53
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();
@pirosuke
pirosuke / index.html
Created May 8, 2019 14:32
Image Convert With OpenCV.js
<html>
<head>
<title>OpenCV.js Test</title>
</head>
<body>
<table>
<tr>
<th>source</th>
<th>output</th>
</tr>
@ArsalRaza
ArsalRaza / VideoUtils.java
Last active January 25, 2024 11:39
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;
@MeNiks
MeNiks / RealPathUtil.kt
Last active July 10, 2024 08:57
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
@jesperorb
jesperorb / php_form_submit.md
Last active April 30, 2024 22:27
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.

@eneko
eneko / list-of-curl-options.txt
Last active November 15, 2024 22:18
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@liangfu
liangfu / ffmpeg.md
Created May 24, 2017 04:46 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz: