Skip to content

Instantly share code, notes, and snippets.

View even4void's full-sized avatar

chl even4void

View GitHub Profile
@even4void
even4void / neomuttrc
Created May 27, 2025 11:37
Neomutt (20250510) config file
set certificate_file = /opt/homebrew/opt/ca-certificates/share/ca-certificates/cacert.pem
set folder = ~/.mail
set header_cache = ~/.cache/neomutt
set mailcap_path = ~/.config/neomutt/mailcap
set message_cachedir = ~/.cache/neomutt
set tmpdir = ~/.cache/neomutt/tmp
set attach_save_dir = ~/tmp
set beep_new = no
set check_new
@even4void
even4void / tmux.conf
Created May 27, 2025 11:34
Tmux (3.5a) config file
set -g default-command "${SHELL}"
if-shell "hash infocmp >/dev/null 2>&1 && \
infocmp tmux-256color >/dev/null 2>&1" \
"set -gq default-terminal 'tmux-256color'" \
"set -gq default-terminal 'screen-256color'"
# set -gqa terminal-overrides ',*:Tc'
set -asq terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -asq terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
@even4void
even4void / init.lua
Created May 27, 2025 11:32
Neovim (0.11) init file
-- Builtins {{{
local disabled_built_ins = {
"gzip",
"zip",
"zipPlugin",
"tar",
"tarPlugin",
"getscript",
"getscriptPlugin",
"vimball",
@even4void
even4void / treediff
Created September 13, 2024 17:32
Diff for directories
#!/bin/zsh
dir1="$1"
dir2="$2"
if [ ! -d "$dir1" ]; then
echo "Directory $dir1 does not exist."
exit 2
fi
if [ ! -d "$dir2" ]; then
@even4void
even4void / catix
Created September 10, 2024 18:18
Cat for image via sixel graphic protocol
#!/usr/bin/env bash
if [[ "$1" == "-g" ]]; then
GEOMETRY="$2"
shift 2
fi
for f in "$@"; do
convert "$f" -geometry ${GEOMETRY:=800x480} sixel:-
done
@even4void
even4void / .Renviron
Last active May 27, 2025 11:39
Old R stuff from years ago
R_LIBS_USER="~/.local/lib/R/library"
R_PROFILE="~/.config/R/Rprofile"
RENV_CONFIG_USER_PROFILE=TRUE
RENV_PATHS_ROOT="~/.cache/org.R-project.R/R/renv"
@even4void
even4void / init.el
Created August 20, 2024 18:50
Minimal config for Emacs and org-mode
;;; init.el -*- lexical-binding: t; -*-
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(setq-default inhibit-startup-screen t
initial-scratch-message ""
select-enable-clipboard t
custom-file "~/.emacs.d/custom.el")
https://github.com/eliben/4clojure-solutions.git
https://github.com/bcc32/99.git
https://github.com/politrons/Dive_into_Haskell.git
https://github.com/hbctraining/Intro-to-R.git
https://github.com/ppham27/MLaPP-solutions.git
https://github.com/ArthurZC23/Machine-Learning-A-Probabilistic-Perspective-Solutions.git
https://github.com/nayuki/Nayuki-web-published-code.git
https://github.com/davidemms/OrthoFinder.git
https://github.com/ctgk/PRML.git
https://github.com/wentaocn/Programming-in-Haskell.git
@even4void
even4void / make_package.R
Last active June 1, 2022 13:03
ROCAD analysis
# Time-stamp: <2010-04-05 17:11:20 chl>
#
# Automaticaly collate R file and try to build a package with
# documentation generated by Roxygen.
#
require(roxygen)
rm(list=ls())
package.skeleton('rocad',code_files=c('rocad.R','rocad-package.R'),force=T)
roxygenize('rocad',roxygen.dir='rocad',copy.package=F,unlink.target=F)
try(system("R CMD build rocad"))
@even4void
even4void / pdf2img.sh
Created January 11, 2022 17:29
Convert page from a PDF to a PNG
#!/usr/bin/env bash
# Note: pdftoppm has page range so the first line is probably not necessary.
f="/tmp/tmp.$RANDOM"
pdftk "$1" cat $2 output $f
pdfcrop $f $f.crop
pdftoppm -png -rx 300 -ry 300 $f.crop $HOME/"$1".png
rm $f $f.crop