Skip to content

Instantly share code, notes, and snippets.

@milesrichardson
milesrichardson / open-vlc-m3u8-url-with-http.md
Created July 10, 2024 21:50
How to use VLC to watch m3u8 playlist at URL with custom HTTP referrer and user agent

Imagine this: it's Sunday afternoon at 1pm, and you want to watch some live content. But you don't have a TV subscription. So you do a little Googling, and eventually you find yourself on a sketchy website where you can watch the content you're looking for. But while the website has a video player, it's surrounded by advertisements, and probably a cryptominer too. You don't want this website eating your CPU for 2 hours while you're watching your favorite Sunday afternoon content.

Wouldn't it be nice if you could watch that video in VLC instead? Then you can close the sketchy website and still watch your content. It's like having your cake and taking a bite of it too!

Here's how you do it:

  1. Capture the m3u8 request in dev tools. Open the site (or just the iframe, if possible) in DevTools and click "play." Search the network tab for m3u8 and grab the first request.

  2. Run VLC with command line flags to set the User Agent and Referrer. From the request body, you need to copy the requested URL,

@Kyle-Ye
Kyle-Ye / iPhone Mirroring.md
Last active March 20, 2025 11:27
Launch iPhone Mirroring.app on macOS 15 Beta 1
@cbatson
cbatson / how-to-install-ifuse-on-macos.md
Last active April 23, 2025 06:01
How To Install ifuse on macOS (Updated Nov 2023)
@thomasdarimont
thomasdarimont / MainMethodFinder.java
Last active March 7, 2025 22:51
Small tool to find classes with executable main methods in a given JDK.
import jdk.internal.org.objectweb.asm.*;
import java.io.*;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.Consumer;
/**
@rumplestilzken
rumplestilzken / Rooting Your Unihertz Titan
Last active December 20, 2024 01:40
Rooting Your Titan
Unlock your Titan.
Obtain Magisk.apk [Magisk 25.2](https://github.com/topjohnwu/Magisk/releases/download/v25.2/Magisk-v25.2.apk)
Obtain Stock Rom
Extract Stock Rom and copy boot.img to your Titan.
Run Magisk on boot.img, make sure to include vbmeta patch. Do not check this for Titan Pocket and Titan Slim
Copy new Magisk boot.img to your computer
Boot into bootloader mode (adb reboot fastboot or Power + Volume Up while booting, once booted into recovery, if you get
a No Command screen, hold power and tap volume up, boot to bootloader)
fastboot flash boot magisk-boot.img
@rinogo
rinogo / test-brisk.py
Created April 14, 2021 19:01
BRISK keypoint detection and brute force matching using OpenCV (Source: https://stackoverflow.com/a/65863713/114558)
# Imports
import cv2 as cv
import matplotlib.pyplot as plt
import sys
# Open and convert the input and training-set image from BGR to GRAYSCALE
image1 = cv.imread(filename = sys.argv[1],
flags = cv.IMREAD_GRAYSCALE)
image2 = cv.imread(filename = sys.argv[2],
@Gowsky
Gowsky / Border.kt
Last active June 1, 2023 06:35
Corrected Modifier.border for Jetpack Compose. It adjusts inner rounded corner rectangle instead of using the same radius as outer rounded corner rectangle.
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Divider
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawWithCache
import androidx.compose.ui.geometry.*

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@goofwear
goofwear / AdbCommands
Created October 15, 2020 04:16 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@vganin
vganin / ComposeNumberPicker.kt
Last active January 14, 2024 11:53
Jetpack Compose simple number picker
@Composable
fun NumberPicker(
state: MutableState<Int>,
modifier: Modifier = Modifier,
range: IntRange? = null,
textStyle: TextStyle = LocalTextStyle.current,
onStateChanged: (Int) -> Unit = {},
) {
val coroutineScope = rememberCoroutineScope()
val numbersColumnHeight = 36.dp