This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#run with 'sudo ./hibernate.sh' | |
#argument is the name of the eth network adapter e.g. 'eno1' | |
ethtool -s $1 wol pumbg | |
systemctl hibernate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Atuin configuration for fish is broken as of 2024-1-8 (using $"(...)" instead of (...)) | |
#Add source <this file> to $HOME/.config/fish/config.fish | |
set -gx ATUIN_SESSION (atuin uuid) | |
function _atuin_preexec --on-event fish_preexec | |
if not test -n "$fish_private_mode" | |
set -g ATUIN_HISTORY_ID (atuin history start -- "$argv[1]") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Minimal Multidispatch example. | |
# Type safe: if types not included in overload set exception is raised | |
# Author: Ugo Varetto | |
# License SPDX: UPL-1.0 (Permissive license) | |
import sys | |
def __create_overload_table(obj): | |
if getattr(obj, '__overload_table', None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install libx11-xcb-dev libxcb-util libxcb-util-dev libxcb-image0-dev libxcb1-dev libxkbcommon-dev libxkbcommon-x11-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true" | |
keybinds { | |
normal { | |
// uncomment this and adjust key if using copy_on_select=false | |
// bind "Alt c" { Copy; } | |
} | |
locked { | |
bind "Ctrl g" { SwitchToMode "Normal"; } | |
} | |
resize { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
theme = "tokyonight" | |
[editor] | |
line-number = "relative" | |
mouse = false | |
bufferline = "multiple" | |
rulers = [80] | |
[editor.statusline] | |
right = ["diagnostics", "selections", "position", "position-percentage", "file-encoding", "file-line-ending", "file-type"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set prefix (Ctrl+a) | |
set-option -g prefix C-a | |
unbind-key C-a | |
bind-key C-a send-prefix | |
# Use Alt-arrow keys to switch panes (Alt+left/right/up/down) | |
bind -n M-Left select-pane -L | |
bind -n M-Right select-pane -R | |
bind -n M-Up select-pane -U | |
bind -n M-Down select-pane -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implementation of Result<Result,Error> type a la Rust. | |
// author: Ugo Varetto | |
// License: Zero-clause BSD | |
// SPDX identifier: 0BSD | |
#include "result.h" | |
//----------------------------------------------------------------------------- | |
Result<int, std::string> Foo(int i) { | |
if (i == 0) { | |
return Err(std::string("Error")); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sha256.c - SHA256 reference implementation | |
// | |
//----------------------------------------------------------------------------- | |
#include <assert.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
//----------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cabal-version: 3.4 | |
-- The cabal-version field refers to the version of the .cabal specification, | |
-- and can be different from the cabal-install (the tool) version and the | |
-- Cabal (the library) version you are using. As such, the Cabal (the library) | |
-- version used must be equal or greater than the version stated in this field. | |
-- Starting from the specification version 2.2, the cabal-version field must be | |
-- the first thing in the cabal file. | |
-- Initial package description 'y' generated by | |
-- 'cabal init'. For further documentation, see: |
NewerOlder