This is a conversation from a chatbot, Google Gemini. https://gemini.google.com/app (free, not signed on Google account)
I can't recall the exact question I asked, but the response is quite explanatory.
Subject is about JavaScipt DOM Event.
--- Calculates the lowest and highest numerical indices and the count of numerical indices in a table. | |
-- | |
-- Iterates over all keys using `pairs` and finds the minimum and maximum | |
-- among the numerical keys. Non-numerical keys are ignored. | |
-- Also counts the total number of numerical keys. | |
-- Returns 0, 0, 0 for tables with no numerical keys (including empty tables). | |
-- | |
---@param tbl table The input table. | |
---@return number The lowest numerical index found, or 0 if none. | |
---@return number The highest numerical index found, or 0 if none. |
This is a conversation from a chatbot, Google Gemini. https://gemini.google.com/app (free, not signed on Google account)
I can't recall the exact question I asked, but the response is quite explanatory.
Subject is about JavaScipt DOM Event.
#!/usr/bin/python | |
import os | |
import subprocess | |
import sys | |
import time | |
def get_video_bitrate(input_file): | |
# Use ffprobe to get the video bitrate | |
ffprobe_command = [ | |
'ffprobe', |
#!/usr/bin/env bash | |
# Initialize variables to customize output | |
: "${FFILE:="${HOME}/.fonts/i/impact.ttf"}" # Let user choose font file | |
: "${FSIZE:=72}" # Let user choose font size in px | |
: "${BSIZE:=5}" # Let user choose stroke size in px | |
: "${OFFSET:='(h*0.05)'}" # Let user choose text offset in px | |
# TTEXT - Text to display at the top of the image | |
# BTEXT - Text to display at the bottom of the image | |
# Exit value index: |
__input="$1" # Required | |
__phase="$2" # Aka controller | |
__video_file=$(basename -- "$__input") | |
__video_name="${__video_file%.*}" | |
__video_ext="${__video_file##*.}" | |
__csv_name="${__video_name}-Scenes.csv" | |
# TODO: file checks | |
# Detect content and write it to be revised later. |
-- https://github.com/openresty/lua-tablepool | |
-- With slightly modifications. | |
local newtab = require "table.new" | |
local cleartab = require "table.clear" | |
local setmetatable = setmetatable | |
local _M = newtab(0, 2) | |
local max_pool_size = 200 |
#!/bin/bash | |
# Usage: | |
# v9-ffmpeg.sh 720 input.mp4 | |
# v9-ffmpeg.sh 720 input.mp4 output.webm | |
# | |
# Best usage for scaling down video OR just simply reencode video into WEBM. | |
# Change me. | |
OUTPUT_PREFIX="" |
------------------------------------------------------------------------------- | |
--- main.lua v0.2 | |
------------------------------------------------------------------------------- | |
local main = { | |
_VERSION = '0.2', | |
} | |
local arg, os, package, love, jit = arg, os, package, love, jit | |
local assert, pcall, require, tonumber, setmetatable, print = | |
assert, pcall, require, tonumber, setmetatable, print |
#!/bin/bash | |
# | |
# Small and simple bash script that reencode video into 720p (any orientation). | |
# Required ffmpeg binary on OS's $PATH (on Windows %PATH%) or current working directory. | |
# | |
# You can run this on Windows under a POSIX subsystem (MSYS2, CygWin, Bash from Git for Windows) | |
# | |
# Usage: | |
# 720pify.sh ../video1.mp4 somedir/video2.mp4 | |
# |
---@alias entity {} # also known as character/object/thing (unique) | |
---@aliss component.area { width: number, height: number } # a 2d object component, also known as size | |
---The component constructor/giver/assembler, I don't know, I don't really know. | |
---@type table<entity, component.area>|fun(width?: number, height?: number): c: component | |
return setmetatable({}, { | |
-- stored as weak reference | |
__mode = 'kv', | |
---@param list table<entity, component.size> |