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
@rmtbb
rmtbb / ChatGPT Canvas HTML Renderer from Clipboard.url
Last active April 24, 2025 10:07
Bookmarklet that lets you render a full HTML page with any included css and javascript that is currently copied to your clipboard. Also works for SVG code. Useful with ChatGPT Canvas
javascript:(function(){try{navigator.clipboard.readText().then(function(t){if(t){var e=window.open("","_blank","width=800,height=600");e.document.open(),e.document.write(t),e.document.close()}else alert("Clipboard is empty. Please copy some text to the clipboard first.")}).catch(function(t){console.error("Failed to read clipboard contents: ",t),alert("An error occurred while trying to access the clipboard. Please ensure your browser allows clipboard access.")})}catch(t){console.error("An error occurred:",t),alert("An error occurred while trying to open the new window with the clipboard content.")}})();//bookmarklet_title: HTML Preview from Clipboard
@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 October 15, 2024 18:58
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
@eNV25
eNV25 / hp-bios-update.md
Last active April 16, 2025 18:44
Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

To update the BIOS/UEFI firmware requires HP-specific files in the EFI System Partition, also referred to as ESP.

On a Linux system, the ESP is typically mounted on /boot/efi or /efi. Whithin you should also find a EFI directory, e.g. /boot/efi/EFI or /efi/EFI. This article assumes that the ESP is mounted on /efi and that the /efi/EFI directory exists. You can replace that with the mount point your system uses.

The HP-specific files are located in /efi/EFI/HP or /efi/EFI/Hewlet-Packard. These files typically come preinstalled in HP Windows PCs. If you have these files you could skip Install HP-specific files.

@ojroques
ojroques / 52-osc
Created January 17, 2021 11:54
Enable support of OSC52 for urxvt

NAME

52-osc - Implement OSC 52 ; Interact with X11 clipboard

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 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)
@efrecon
efrecon / run.tpl
Last active April 17, 2025 07:01
`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}}