Skip to content

Instantly share code, notes, and snippets.

View bartman's full-sized avatar
🏋️‍♀️
🥩☕

Bart Trojanowski bartman

🏋️‍♀️
🥩☕
View GitHub Profile
@bartman
bartman / keyboards.md
Last active June 28, 2024 14:08
keyboards I like

Requirements:

  • 60/65% layout (no numpad, no function keys, arrows optional)
  • qmk_firmware support
  • split backspace (split spacebar optional)

My builds:

Hotswap keyboards:

@bartman
bartman / README.md
Last active May 12, 2024 15:07
cpp scripting

want to write scripts in C++? sure you do.

put c-run in your path, then you can write scripts in C++ (or in C).

#!/usr/bin/env c-run
#include <iostream>
int main() {
    std::cout << "hello world\n";
}
@bartman
bartman / debugging.lua
Last active January 30, 2024 19:53
debugging via nvim-dap
-- ~/.config/nvim/lua/plugins/debugging.lua
-- https://github.com/mfussenegger/nvim-dap
-- https://github.com/jay-babu/mason-nvim-dap.nvim
return {
"mfussenegger/nvim-dap",
dependencies = {
"vadimcn/codelldb", -- lldb
"Microsoft/vscode-cpptools", -- gdb
"rcarriga/nvim-dap-ui",
@bartman
bartman / fndump
Created January 23, 2024 18:33
fndump
#!/bin/bash
SELF="${0##*/}"
DEBUG=false
OBJ= SYM= PREFIX=
dbg() { $DEBUG && echo >&2 "# $@" ; }
die() { echo >&2 "ERROR: $@" ; exit 1 ; }
showhelp() {
@bartman
bartman / netsonsole
Created January 23, 2024 18:30
netsonsole
#!/bin/bash
set -e
die() { echo >&2 "$@" ; exit 1 ; }
TGT_IP="$1"
TGT_PORT=${2:-6666}
if [ -z "$TGT_IP" ] ; then
TTY=${SSH_TTY#/dev/}
@bartman
bartman / config_nvim_init.vim
Last active January 28, 2024 03:15
neovim config
" this file goes in ~/.config/nvim/init.vim
" you will also need to install vim-plug in ~/.local/share/nvim/site/autoload/plug.vim
" see https://github.com/junegunn/vim-plug?tab=readme-ov-file#unix-linux
" on first run, use :PlugInstall to download all packages
" then reload config with ,so (or restart nvim)
syntax on
filetype plugin indent on
"let mapleader = ','
@bartman
bartman / shell.cpp
Last active January 9, 2023 20:25
run C file as a script, complied with any compiler
#!/bin/bash
#if 0
set -e
src=$0
tmp=/tmp/$$.cpp
exe=/tmp/$$
sed -e 1d < $src > $tmp
trap "rm -f $tmp $exe" EXIT
( set -x ; g++ -o $exe $tmp )
$exe "$@"
@bartman
bartman / mktags
Last active January 23, 2023 13:30
mktags
#!/usr/bin/make -f
#
# This is a script that bilds ctags/csope files.
#
# By default, it will build indexes in the current directory:
#
# mktags
#
# You can invoke it to build different subdirectories:
#
@bartman
bartman / cleanup-boot
Created February 11, 2021 13:26
cleanup-boot
#!/bin/bash
# this script will remove any stale kernel- and kernel-headers- packages
# it will keep the current (uname -r) and latest kernel package and its headers
SUDO=sudo
while [ -n "$1" ] ; do
case "$1" in
-h) echo "${0##*/} [ -h ] [ -n ]" ; exit 0 ;;
-n) SUDO=echo ;;