Skip to content

Instantly share code, notes, and snippets.

View SanchayanMaity's full-sized avatar
🤘

Sanchayan Maity SanchayanMaity

🤘
View GitHub Profile
@SanchayanMaity
SanchayanMaity / hlssink4.py
Last active January 12, 2025 00:01
Test code for hlssink4
#!/usr/bin/env python3
import os # noqa: I001
import signal
import sys
import subprocess
import gi
gi.require_version("GLib", "2.0")
@SanchayanMaity
SanchayanMaity / Yoneda.md
Created February 1, 2024 16:29 — forked from gregberns/Yoneda.md
Introduction to Yoneda and Coyoneda

Introduction to Yoneda and Coyoneda

Yoneda (and its duel Coyoneda) is well known in the Category Theory field and has been ported over to functional languages such as Haskell. Each have their uses - sometimes in similar scenarios, also in very different ways.

This will be a newbie's explanation of the concept, using Haskell to illustrate, without any Category Theory.

From what I've read, the Yonedas are not 'daily-drivers' (not used everyday), but rather can be pulled out when the time is right.

Uses: Both Yoneda's can be used to help speed up a program where there are many fmap with long lists or big trees involved. Coyoneda can be used if you want to create an 'interface' and build up calculations, then pass those calculations to an 'executor' to run them.

@SanchayanMaity
SanchayanMaity / whepsrc.py
Last active June 4, 2025 11:12
WHEP source sample code
#!/usr/bin/env python3
import signal
import sys
import gi # type: ignore
gi.require_version("GLib", "2.0")
gi.require_version("Gst", "1.0")
from gi.repository import GLib, Gst # type: ignore
Trying to use the 1.20 devenv just gives
```bash
0:00:00.001824389 294176 0x5594fe4b8e90 ERROR GST_PLUGIN_LOADING gstpluginloader.c:442:gst_plugin_loader_try_helper: Spawning gst-plugin-scanner helper failed: Failed to execute child process “/usr/local/libexec/gstreamer-1.0/gst-plugin-scanner” (No such file or directory)
(gst-inspect-1.0:294176): GStreamer-WARNING **: 10:22:46.304: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though.
Fatal Python error: init_sys_streams: <stdin> is a directory, cannot continue
Python runtime state: core initialized
Current thread 0x00007f5a197f0b80 (most recent call first):

$argon2id$v=19$m=64,t=512,p=2$PctXBL12qwvgKzVVio6/ZQ$TMJtP0mn0YQZc1ocovqPeg

@SanchayanMaity
SanchayanMaity / gist:4473229e2fb2e45e13d448fadecb9290
Created December 16, 2021 15:32 — forked from junegunn/gist:f4fca918e937e6bf5bad
Browsing git commit history with fzf
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort)
fshow() {
local out shas sha q k
while out=$(
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
fzf --ansi --multi --no-sort --reverse --query="$q" \
--print-query --expect=ctrl-d --toggle-sort=\`); do
q=$(head -1 <<< "$out")
k=$(head -2 <<< "$out" | tail -1)
@SanchayanMaity
SanchayanMaity / README.md
Created December 3, 2019 16:29 — forked from mill1000/README.md
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites