Skip to content

Instantly share code, notes, and snippets.

@randomphrase
randomphrase / cmdoptions.cpp
Last active May 25, 2024 08:26
Demonstration of how to do subcommand option processing with boost program_options
#define BOOST_TEST_MODULE subcommand options
#include <boost/test/unit_test.hpp>
#include <boost/program_options.hpp>
#include <boost/variant/variant.hpp>
#include <boost/variant/get.hpp>
struct GenericOptions {
bool debug_;
};

Per-directory Bash history (w/o aliasing cd)

I use Bash’s PROMPT_COMMAND variable:

The value of the variable PROMPT_COMMAND is examined just before Bash prints each primary prompt. If PROMPT_COMMAND is set and has a non-null value, then the value is executed just as if it had been typed on the command line.

The source code should be pretty straight forward, but if not, please ask in the comments. Put this in your .bashrc or similar:

# per-directory Bash history
@yottatsa
yottatsa / vortex86.cfg
Created January 2, 2023 00:12
OpenOCD configuration that resets and halts Vortex86SX
noinit
adapter driver usb_blaster
usb_blaster_lowlevel_driver ftdi
verify_jtag disable
verify_ircapture disable
adapter srst delay 100
reset_config srst_only srst_gates_jtag separate
adapter speed 400