Skip to content

Instantly share code, notes, and snippets.

View scivision's full-sized avatar
💭
I will be slow to respond.

scivision

💭
I will be slow to respond.
View GitHub Profile
@scivision
scivision / LICENSE
Last active July 22, 2026 19:29
Caffeinate Python: inhibit Windows from suspend/sleep while subprocess is running
The MIT License (MIT)
Copyright © 2025 SciVision, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
@WardBrian
WardBrian / BoostUT.cmake
Last active September 22, 2025 03:49
CTest registration for Boost.UT. License: BSD-3-Clause
FetchContent_Declare(boost_ut
GIT_REPOSITORY https://github.com/boost-ext/ut.git
GIT_TAG v2.3.1)
FetchContent_MakeAvailable(boost_ut)
# link this object to your test executable, then call discover_boost_ut_test() on it
add_library(boost_ut_runner OBJECT test_runner.cpp)
target_link_libraries(boost_ut_runner PUBLIC Boost::ut)
@scivision
scivision / Readme.md
Last active August 26, 2025 14:22
Quickly upload WSJT-X default log to LoTW using TQSL
@scivision
scivision / CMakeLists.txt
Last active March 9, 2026 02:44
nanosleep() for Visual Studio MSVC compiler on Windows
cmake_minimum_required(VERSION 3.21)
if(NOT CMAKE_BUILD_TYPE AND NOT DEFINED ENV{CMAKE_BUILD_TYPE})
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build.")
endif()
project(SleepDemo LANGUAGES C CXX)
enable_testing()
@scivision
scivision / CMakeLists.txt
Last active August 11, 2026 20:19
Identify if CPU is x86_64v3 capable
cmake_minimum_required(VERSION 3.19...4.2)
project(InstructionSet LANGUAGES CXX)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
enable_testing()
include(CheckIncludeFileCXX)
@scivision
scivision / CMakeLists.txt
Last active April 16, 2026 02:11
Xcode + Homebrew GCC fix after macOS upgrade
cmake_minimum_required(VERSION 3.20)
project(min LANGUAGES CXX Fortran)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
# set OFF if not using C++ modules, or it can trip similar compiler errors due to "-fmodules-ts" flags auto-added when ON.
message(STATUS "CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}")
foreach(i IN ITEMS OS_NAME OS_VERSION OS_RELEASE OS_PLATFORM)
@scivision
scivision / Readme.md
Last active July 11, 2025 21:56
Intel oneAPI GitHub Actions (with caching) MKL and MPI (C, C++, Fortran) and CMake

GitHub Actions Intel oneAPI with caching

Using GitHub Actions cache is a little more complicated than not caching, but makes the setup time dramatically shorter.

This example uses MKL and MPI.

To avoid problems with the CI executing the scripts, do one time:

@scivision
scivision / CMakeLists.txt
Last active July 27, 2026 12:46
OpenMP with CMake, for macOS, Linux, and Windows
cmake_minimum_required(VERSION 3.19)
project(OpenMPdemo LANGUAGES C CXX)
find_package(OpenMP COMPONENTS C CXX REQUIRED)
enable_testing()
add_executable(hello_c hello_openmp.c)
target_link_libraries(hello_c PRIVATE OpenMP::OpenMP_C)
@scivision
scivision / README.md
Last active June 29, 2026 21:44
Extract a .zst file in Python

Extract Zstd archives with Python

Uses compression.zstd (Python 3.14+) or zstandard (Python < 3.14) to extract Zstandard-compressed files and archives.

  • .zst files (raw Zstandard-compressed single files)
  • .tar.zst archives
@scivision
scivision / _redirects
Last active February 15, 2021 08:40
Netlify public/_redirects for bot log diversion
# This file is for use with a Hugo blog.
# be careful using this on real-life site, so that the patterns below don't dump legitimate traffic!
# we use 410 to be more aggressive than 404, and to unclutter Netlify statistics
/.env /bot.html 410
/blog.zip /bot.html 410
/.git/* /bot.html 410
/browserconfig.xml /bot.html 410
/OLD/* /bot.html 410
/404.html /bot.html 410