Skip to content

Instantly share code, notes, and snippets.

View pocco81's full-sized avatar
🍁
I may be slow to respond.

pocco pocco81

🍁
I may be slow to respond.
  • Mars
View GitHub Profile

A metatable can be defined like

local t = setmetatable({}, {
  __tostring = function() return 'custom tostring behavior!' end
})

Here are the metamethods that you can define, and their behavior

Operators

🌞 Morning 185 commits ██████▏░░░░░░░░░░░░░░ 29.4%
🌆 Daytime 237 commits ███████▉░░░░░░░░░░░░░ 37.7%
🌃 Evening 190 commits ██████▎░░░░░░░░░░░░░░ 30.2%
🌙 Night 17 commits ▌░░░░░░░░░░░░░░░░░░░░ 2.7%
@dkdndes
dkdndes / ascii_art_utf8
Created January 18, 2021 19:18
Ascii Art in one line (utf8)
©️ Copyright Sign
®️ Registered Sign
‼️ Double Exclamation Mark
⁉️ Exclamation Question Mark
™️ Trade Mark Sign
ℹ️ Information Source
↔️ Left Right Arrow
↕️ Up Down Arrow
↖️ North West Arrow
↗️ North East Arrow
@roalcantara
roalcantara / XDG.cheat-sheet.md
Last active May 26, 2024 04:29
XDG cheat sheet

XDG - Base Directory Specification

Directories

Base

The intended use-case for BaseDirectories is to query the paths of user-invisible standard directories that have been defined according to the conventions of the operating system the library is running on.

@probonopd
probonopd / Wayland.md
Last active June 25, 2024 01:43
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

[Desktop Action new-private-window]
Exec=/home/a/Downloads/firefox/firefox --private-window %u
Name[en_US]=New Private Window
Name=New Private Window
Name[ach]=Dirica manyen me mung
Name[af]=Nuwe privaatvenster
Name[an]=Nueva finestra privada
Name[ar]=نافذة خاصة جديدة
Name[as]=নতুন ব্যক্তিগত উইন্ডো
Name[ast]=Ventana privada nueva
@td-shi
td-shi / POSIX_commands.md
Last active June 17, 2024 09:38
About POSIX commands list

POSIX commands

You should refer the original page. The all copyrights of these documents belong to them.

Using frequent

filter

  • grep :: search a file for a pattern
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active June 25, 2024 02:19
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@davidmerrick
davidmerrick / cloneAll.sh
Last active January 15, 2022 23:26
Clone all github repos in an org
#!/bin/bash
# Note: This script requires that you have $GITHUB_TOKEN set.
# Get one here: https://github.com/settings/tokens
ORG=yourOrg
HAS_NEXT=true
i=1
while $HAS_NEXT
@looselyrigorous
looselyrigorous / 99-gdm-use-materia-theme.hook
Last active June 3, 2023 10:12
Pacman hook to replace GDM shell theme with Materia-compact
[Trigger]
Operation = Upgrade
Type = Package
Target = gnome-shell
[Action]
Description = Replace GDM theme with Materia-compact
When = PostTransaction
Exec = /usr/bin/sh -c "cd /usr/share/themes/Materia-compact/gnome-shell && glib-compile-resources --target=/usr/share/gnome-shell/gnome-shell-theme.gresource gnome-shell-theme.gresource.xml"
Depends = materia-gtk-theme