Skip to content

Instantly share code, notes, and snippets.

View joernassimian's full-sized avatar

Joe R. Nassimian joernassimian

  • Vienna -- Austria
View GitHub Profile
@bjin
bjin / acme-0.5x.hook
Last active April 21, 2024 01:55
simple 0.5x prescaler for mpv, best combined with "--cscale=bilinear --scaler-resizes-only --window-scale=0.5"
//!DESC acme-0.5x
//!HOOK LUMA
//!BIND HOOKED
//!WIDTH HOOKED.w 2 /
//!HEIGHT HOOKED.h 2 /
//!WHEN HOOKED.w 2 % ! HOOKED.h 2 % ! *
//!OFFSET 0.25 0.25
vec4 hook() {
return HOOKED_texOff(vec2(-0.25,-0.25));
}
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 8, 2025 20:45
set -e, -u, -o, -x pipefail explanation
local sense=-20
local speed = mp.get_property("speed")
local detect = false
function f(msg)
if string.find(msg.text, "silence_end") and detect then
mp.set_property("speed",speed)
endmsg=msg.text
detect = false
--print("end")
elseif string.find(msg.text, "silence_start") and detect==false then
@avih
avih / equalizer.lua
Last active February 26, 2025 19:12
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)
@ekisu
ekisu / vo_battery.lua
Created June 27, 2015 11:39
vo_battery.lua implementation for Linux
-- If the laptop is on battery, the VO set in the config will be choosen,
-- else the one defined with „hqvo“ is used.
local hqvo = "opengl-hq:interpolation"
local utils = require 'mp.utils'
if mp.get_property_bool("option-info/vo/set-from-commandline") == true then
return
end
t = {}
t.args = {"/bin/cat", "/sys/class/power_supply/AC/online"}
res = utils.subprocess(t)
@Belphemur
Belphemur / build_nginx.sh
Last active November 13, 2022 13:05 — forked from MattWilcox/build_nginx.sh
Compiling Nginx with LibreSSL (and http2)
#!/usr/bin/env bash
# names of latest versions of each package
export NGINX_VERSION=1.15.5
export VERSION_NGINX=nginx-$NGINX_VERSION
export VERSION_LIBRESSL=libressl-2.8.1
export VERSION_PCRE=pcre-8.42
#export NPS_VERSION=1.9.32.10
#export VERSION_PAGESPEED=v${NPS_VERSION}-beta
@MattWilcox
MattWilcox / build_nginx.sh
Last active March 6, 2022 18:01
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2d
export VERSION_NGINX=nginx-1.9.7
# URLs to the source directories
export SOURCE_OPENSSL=https://www.openssl.org/source/
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@scvalex
scvalex / closure.c
Created April 11, 2011 13:41
A closure via nested-functions in C
#include <stdio.h>
typedef int (*pluser)(int);
int main() {
int plus(int x, int y) {
return x + y;
}
pluser mk_pluser(int y) {
@dlivingstone
dlivingstone / blocks.uwsm
Created November 1, 2010 07:17
This sample code will load and display a rotating 3D model. Uses OpenGL and the GLTools library from the OpenGL SuperBible. More details on the UWSM model format used (and sample model data) available at http://3dgamedev.wordpress.com
uwsm0_2
378
48.4251968503937 0 0 0 -38.18897637795276 0 0 0 0 48.4251968503937 -38.18897637795276 0 0 0 11.81102362204724 0 -38.18897637795276 0 0 -38.18897637795276 11.81102362204724 0 0 0 0 0 11.81102362204724 48.4251968503937 0 0 0 0 0 48.4251968503937 0 11.81102362204724 48.4251968503937 0 0 48.4251968503937 -38.18897637795276 11.81102362204724 48.4251968503937 -38.18897637795276 0 48.4251968503937 -26.57597781267043 11.81102362204724 48.4251968503937 0 11.81102362204724 48.4251968503937 -38.18897637795276 11.81102362204724 0 -38.18897637795276 0 48.4251968503937 -38.18897637795276 0 0 -38.18897637795276 11.81102362204724 40.11978340741202 -38.18897637795276 11.81102362204724 31.92395467371481 -38.18897637795276 11.81102362204724 0 -38.18897637795276 11.81102362204724 27.25139183695274 -35.34645501628111 11.81102362204724 0 0 11.81102362204724 29.82020513564828 -37.31757478744946 11.81102362204724 31.92395467371481 -38.18897637795276 11.81102362204724 25.28027206578439 -32.77764171758558 11.81102362204724