Skip to content

Instantly share code, notes, and snippets.

@avih
avih / cosmocc
Last active May 2, 2023 12:20
cosmocc script to simplify usage of the cosmopolitan.zip bundle
#!/bin/sh
[ "${COSMOXX-}" ] && set -x || :
# name: cosmocc
# self-contained replacement for the cc command which uses cosmopolitan libc
# see https://justine.lol/cosmopolitan/index.html
# home: https://gist.github.com/avih/467b307051bf01bc9c8475221a59513d
# based on: https://github.com/jart/cosmopolitan/blob/master/tool/scripts/cosmocc
# requires: gcc or clang installed
#
@avih
avih / gist:650844fdc9e30d3958c214c07f14c8fe
Created May 7, 2021 19:46
log for mpv issue #7265 - mpv exits maximized after changing aspect ratio
[ 0.007][v][cplayer] mpv 0.33.0-141-g8edfe70b83 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[ 0.008][v][cplayer] built on Fri May 7 22:40:19 IDT 2021
[ 0.008][v][cplayer] FFmpeg library versions:
[ 0.008][v][cplayer] libavutil 57.0.100
[ 0.008][v][cplayer] libavcodec 59.0.100
[ 0.008][v][cplayer] libavformat 59.0.100
[ 0.008][v][cplayer] libswscale 6.0.100
[ 0.008][v][cplayer] libavfilter 8.0.101
[ 0.008][v][cplayer] libswresample 4.0.100
[ 0.008][v][cplayer] FFmpeg version: git-2021-05-01-c7c138e4
@avih
avih / mujs-262.patch
Created April 18, 2021 03:23
mujs test-262 patchset - on top of mujs dcb3f03 (after 1.0.4 and before 1.0.5)
From 7297871b882483e748946cb7156244be2da9e752 Mon Sep 17 00:00:00 2001
From: "Avi Halachmi (:avih)" <[email protected]>
Date: Thu, 30 Aug 2018 16:24:24 +0300
Subject: [PATCH 1/4] mujs shell: Add compile function.
The new compile function compiles a source code string as a script and
returns a callable object. The optional 'filename' argument is used to
format error messages and stack traces.
---
main.c | 10 ++++++++++
@avih
avih / autoloop.js
Last active December 12, 2017 14:49
/***********************************************************************
autoloop.js - mpv script which reads and play a custom playlist file in
a loop. Images are displayed for a specified duration and other clips are
played normally.
mpv should be invoked as: `mpv --script=path/to/autoloop.js --idle`
The info file should consist of lines where each line is:
<length> <clip-path>
@avih
avih / context.lua
Created February 2, 2017 14:07
flexible mpv context menu using Tcl/Tk, for Windows too!
--[[ *************************************************************
* Context menu for mpv using Tcl/Tk. Mostly proof of concept.
* Avi Halachmi (:avih) https://github.com/avih
*
* Features:
* - Simple construction: ["<some text>", "<mpv-command>"] is a complete menu item.
* - Possibly dynamic menu items and commands, disabled items, separators.
* - Possibly keeping the menu open after clicking an item (via re-launch).
* - Hacky pseudo sub menus. Really, this is an ugly hack.
* - Reasonably well behaved/integrated considering it's an external application.
@avih
avih / equalizer.lua
Last active October 24, 2024 20:02
Visual equalizer script for mpv
--[[
mpv 5-bands equalizer with visual feedback.
Copyright 2016 Avi Halachmi ( https://github.com/avih )
License: public domain
Default config:
- Enter/exit equilizer keys mode: ctrl+e
- Equalizer keys: 2/w control bass ... 6/y control treble, and middles in between
- Toggle equalizer without changing its values: ctrl+E (ctrl+shift+e)