Skip to content

Instantly share code, notes, and snippets.

View gppam's full-sized avatar
💅
streaming "When the Rain Comes"

Pat gppam

💅
streaming "When the Rain Comes"
View GitHub Profile
@gppam
gppam / ytdlp-ffplay.md
Created November 27, 2022 21:55
yt-dlp with ffplay. Playing youtube audio with ffmpeg/ffplay :)

Requirements:

yt-dlp and ffmpeg.

On command prompt/terminal:

  1. Get youtube details and audio only code.

yt-dlp -F https://www.youtube.com/watch?v=Hibkm14x4k0

  1. Use code, for example replace number 139 below.
@gppam
gppam / here_how.md
Created October 28, 2020 09:01
[Flutter] my solution to get listen to an un-broadcasted, single stream again (because i don't want broadcasting?)

This solves my problem where I always get the error "Bad state: Stream has been listened to". I don't want to use broadcasting because I read that it accumulates instances and then it will affect performance and so... here's my solution. The point here is that when I listen to a single stream, it should close the listening by itself when I move to another page, just to prevent that error. I'm not a genius coder, but this is what I have come up with. If you're here because we have the same problem, then I hope this can help you.

  1. Declare your streams and your variables in your provider.
class UserProvider with ChangeNotifier {
@gppam
gppam / FilterableFirestoreRecyclerAdapter.java
Last active March 25, 2020 16:30
Custom FilterableFirestoreRecyclerAdapter (Fixed)
// Adapted from https://gist.github.com/Kishanjvaghela/67c42f8f32efaa2fadb682bc980e9280#gistcomment-2860109
// Thanks to https://github.com/boberproduction, https://github.com/Kishanjvaghela
// A custom FirestoreRecyclerAdapter with Filterable implementation
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.LifecycleOwner;
import android.arch.lifecycle.OnLifecycleEvent;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
@gppam
gppam / combinenfilter.md
Last active April 30, 2019 01:12
Combine columns and filter in Google Sheets

Combines columns D, E, and F and filters each of them, in this case a specific date string.


=ARRAYFORMULA(FILTER('Responses'!D:D, 'Responses'!C:C="April 30 - May 1")&" "&(FILTER('Responses'!E:E, 'Responses'!C:C="April 30 - May 1")&" - "&(FILTER('Responses'!F:F, 'Responses'!C:C="April 30 - May 1"))))
@gppam
gppam / adbwifi.bat
Created April 4, 2019 19:52
adb wifi batch script
@echo off
echo Set up wifi connect thru ADB
pause
adb tcpip 5555
echo Waiting for device to initialize
timeout 3
FOR /F "tokens=2" %%G IN ('adb shell ip addr show wlan0 ^|find "inet "') DO set ipfull=%%G
FOR /F "tokens=1 delims=/" %%G in ("%ipfull%") DO set ip=%%G
echo Connecting to device with IP %ip%...
adb connect %ip%:5555