Skip to content

Instantly share code, notes, and snippets.

How to download Blob Stream

SOURCE, SOURCE

Some video streaming site will hide the download link behind a blob format which will get resolved internally. If you inspect the video player in Chrome you can see something like this:

<video class="jw-video jw-reset" tabindex="-1" disableremoteplayback="" webkit-playsinline="" playsinline="" src="blob:https://play.vstreamplay.xyz/1c36398f-c376-4873-a0ac-7fa07c3968f7"></video>

Connect Firebase Hosting to Namecheap Custom Domain

SOURCE, SOURCE, SOURCE

  1. Go to Firebase's Dashboard > Develop > Hosting > Connect Domain.
  2. Enter the custom domain that you'd like to connect to your Hosting site.
  3. (Optional) Check the box to redirect of all requests on the custom domain to a second specified domain.
  4. Click Continue to initiate the validation process.
  5. Go to Namecheap's Dashboard > Domain List > Manage > Advanced DNS.
  6. Under Host Records, add a new record with:
@vxhviet
vxhviet / RealVideoPath.md
Last active July 1, 2025 15:19
How to select a video from the gallery and get it's real path?

Source: StackOverflow & StackOverflow

Question: How can I get the real path of the selected video when the results are returned?

Answer: Here is the full code for get the video path after selecting from gallery.

Intent intent = new Intent();
    intent.setType("video/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    startActivityForResult(Intent.createChooser(intent,"Select Video"),REQUEST_TAKE_GALLERY_VIDEO);
@vxhviet
vxhviet / LUTFilter.md
Last active April 5, 2025 15:16
How to Apply Color LUT to bitmap images for filter effects in Android?

Source: StackOverflow, StackOverflow

Question: How to Apply Color LUT to bitmap images for filter effects in Android?

Answer:

    final static int X_DEPTH = 64;
    final static int Y_DEPTH = 64; //One little square in the LUT has 64x64 pixels in it
    final static int ROW_DEPTH = 8;
@vxhviet
vxhviet / simplifiedGitFlow.md
Last active March 2, 2025 11:36
A simplified version of Git Flow

Simplified Git-flow

                        RELEASE TAG
o----------------------------o-----------------o------------o------> MASTER
 \                          /  \                \----------/ HOTFIX
  \                        /    \                          \
   \----------------------/      \--------------------o-----o------> DEVELOP
                                  \                  /
 \----------------/ FEATURE
@vxhviet
vxhviet / androidMVP.md
Last active December 14, 2024 05:45
Android MVP General Guideline and Best Practices
@vxhviet
vxhviet / ffmpegCommands.md
Last active November 13, 2024 21:17
FFmpeg commands
@vxhviet
vxhviet / ffmpegVPlayerPart2.md
Last active October 16, 2024 09:17
How to use FFmpeg built by VPlayer in Android Studio?

Source: GitHub

Question: How to use FFmpeg built by VPlayer (version 0.3.2 at the time I write this Gist) in Android Studio?

Answer This will take the FFmpeg built from here and use it as a library for our project in Android Stuio in Window 10.

  1. Download NDK from here, uncompress it to anywhere you want (C:\Users\Viet\AppData\Local\Android\ndk\android-ndk-r11c in my case).
  2. Copy the whole VPlayer_lib folder build from here into the root of your project.
  3. In Android studio, click on app -> F4 -> SDK Location -> Android NDK location.
  4. Edit/create gradle.properties file in the root folder of your project with android.useDeprecatedNdk=true.
@vxhviet
vxhviet / matrixScaling.md
Last active July 1, 2024 14:28
Android scale bitmap with the highest quality

Source: StackOverflow

Question: How to scale Bitmap without losing much quality

Answer: Use Matrix instead of Bitmap.createScaledBitmap()

    /**
     * @param bitmap the Bitmap to be scaled
     * @param threshold the maxium dimension (either width or height) of the scaled bitmap
@vxhviet
vxhviet / regex.md
Created August 8, 2017 04:03
Regular Expression to find a string included between two characters while EXCLUDING the delimiters

Source: StackOverflow

Question: Regular Expression to find a string included between two characters while EXCLUDING the delimiters

Answer:

Easy done:

(?<=\[)(.*?)(?=\])