Skip to content

Instantly share code, notes, and snippets.

View tkapias's full-sized avatar
🏴‍☠️
Working from home

Tomasz Kapias tkapias

🏴‍☠️
Working from home
View GitHub Profile
@marslo
marslo / color-utils.sh
Last active May 27, 2024 13:02
color utilis
#!/usr/bin/env bash
# @author : Anthony Bourdain
# @credit : https://stackoverflow.com/a/55073732/2940319
# @usage :
# - `rgbtohex 17 0 26` ==> 1001A
# - `rgbtohex -h 17 0 26` ==> #1001A
function rgbtohex () {
addleadingzero () { awk '{if(length($0)<2){printf "0";} print $0;}';}
if [[ ${1} == "-h" ]]; then
@tkapias
tkapias / README.md
Last active May 30, 2024 14:13
Displaying HTML emails in Neomutt's pager

Displaying HTML emails in Neomutt's pager

Neomutt configuration

My neomutt config files are huge and even their path is cusmotized with $VIMINIT.

I'm just sharing parts about auto_view and HTML mailcap, please update your config accordingly.

Customize and Build html2text

@elenril
elenril / xscreensaver.lua
Created November 16, 2021 07:47
MPV script that deactivates XScreensaver when video playback is active
-- this script periodically deactivates xscreensaver
-- when video playback is active
local function heartbeat()
if mp.get_property_native("pause") or
mp.get_property_native("idle") or
not mp.get_property_native("vo-configured") then
return
end
@ojroques
ojroques / 52-osc
Created January 17, 2021 11:54
Enable support of OSC52 for urxvt
#! perl
=head1 NAME
52-osc - Implement OSC 52 ; Interact with X11 clipboard
=head1 SYNOPSIS
urxvt -pe 52-osc
@cedws
cedws / defer.sh
Last active July 5, 2024 13:31
Go-like defer 'keyword' for shell
#!/bin/sh
DEFER=
defer() {
DEFER="$*; ${DEFER}"
trap "{ $DEFER }" EXIT
}
@avih
avih / equalizer.lua
Last active July 21, 2024 12:43
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)
@efrecon
efrecon / run.tpl
Last active July 23, 2024 20:03
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}