Skip to content

Instantly share code, notes, and snippets.

@LegalizeAdulthood
LegalizeAdulthood / latest-cmake.sh
Last active February 21, 2024 15:49
Install latest CMake on ubuntu
# run this script with sudo
# From <https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line>
apt remove --purge --auto-remove cmake
apt update
apt install -y software-properties-common lsb-release && \
apt clean all
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
apt update
apt install kitware-archive-keyring
@LegalizeAdulthood
LegalizeAdulthood / CMakePresets.json
Last active March 13, 2024 07:47
clang CMake Presets
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"configurePresets": [
{
"name": "sibling-build-preset",
@LegalizeAdulthood
LegalizeAdulthood / asm-dump.md
Created January 7, 2025 16:51
Disassemble an Object File with MSVC Linker
@LegalizeAdulthood
LegalizeAdulthood / ReadMe.md
Last active April 2, 2025 21:48
Simple vcpkg overlay setup

Simple vcpkg Overlay Ports Setup

The file vcpkg-configuration.json uses an existing vcpkg as the default registry; this assumes vcpkg as a git submodule. The baseline value is the commit hash of the vcpkg submodule. Update the hash as needed to reflect the actual version of the vcpkg registry you've got checked out as a submodule.

Overlay Ports

Use a directory vcpkg-overlays to contain the overlay ports;

@LegalizeAdulthood
LegalizeAdulthood / NuGetCaching.md
Last active April 29, 2025 15:54
Using NuGet Package Caching with VcPkg and GitHub Actions

Using NuGet Package Caching with VcPkg and GitHub Actions

The GitHub Actions Cache mechanism has been removed from vcpkg, so you can't use x-gha in VCPKG_BINARY_SOURCES as a way to re-use built products from one build to the next anymore. I was using x-gha because the setup was trivial for all platforms: just set a couple environment variables.

You can use NuGet packages to achieve the same purpose, although the setup is a little more complicated. Here's what I learned while setting this up for the first time for use with GitHub Actions.

1. GitHub Classic Personal Access Token