Skip to content

Instantly share code, notes, and snippets.

View aozeel's full-sized avatar
🎯
Focus and Achieve

Abdullah Özel aozeel

🎯
Focus and Achieve
View GitHub Profile
@aozeel
aozeel / create-vod-hls.sh
Created November 28, 2021 11:29 — forked from maitrungduc1410/create-vod-hls.sh
Bash scripts to create VOD HLS stream with ffmpeg (Extended version)
#!/usr/bin/env bash
START_TIME=$SECONDS
set -e
echo "-----START GENERATING HLS STREAM-----"
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
# comment/add lines here to control which renditions would be created
renditions=(
@aozeel
aozeel / gist:f7ebd28db3298b4db44d7fda474a8796
Created October 3, 2025 14:14
Custom M2MField to use 'through' with Django Soft Delete
from django.db.models.fields.related_descriptors import ManyToManyDescriptor
from django.db import models
class SoftDeleteManyToManyDescriptor(ManyToManyDescriptor):
def __get__(self, instance, cls=None):
manager = super().__get__(instance, cls)
through_model = self.rel.through
# the FK from through → target model
fk_to_target = [