Skip to content

Instantly share code, notes, and snippets.

@slavik-o
slavik-o / hls.sh
Created November 8, 2024 18:26 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@slavik-o
slavik-o / get_event_stats.js
Created April 12, 2024 14:51
DATA must be sorted by created value and must contain all the required data.
import moment from "moment";
const DATA = [
{ created: "2024-01-01 10:30", status: "offline" },
{ created: "2024-01-01 15:00", status: "online" },
{ created: "2024-01-02 00:30", status: "operational" },
{ created: "2024-01-03 08:15", status: "offline" },
{ created: "2024-01-03 11:23", status: "online" },
];
const TARGET = moment("2024-01-01");