Skip to content

Instantly share code, notes, and snippets.

View jollyjonson's full-sized avatar

JHL jollyjonson

View GitHub Profile
@jollyjonson
jollyjonson / vcpkg_automagic.cmake
Created January 16, 2024 10:40
Use CMake to automatically set up vcpkg as package manager using vcpkg-cmake-integration
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
# pull vcpkg-cmake-integration from github and let it set up vcpkg
include(FetchContent)
FetchContent_Declare(
vcpkg_cmake_integration
GIT_REPOSITORY https://github.com/bitmeal/vcpkg-cmake-integration.git
GIT_TAG origin/master # either manually specify a tag here (e.g. v0.2.2) or use latest master
)
FetchContent_MakeAvailable(vcpkg_cmake_integration)
@jollyjonson
jollyjonson / find_avx.cmake
Last active December 10, 2023 16:10 — forked from UnaNancyOwen/find_avx.cmake
Check for the presence of AVX and figure out the flags to use for it.
# Check for the presence of AVX and figure out the flags to use for it.
macro(CHECK_FOR_AVX)
set(AVX_FLAGS)
include(CheckCXXSourceRuns)
set(CMAKE_REQUIRED_FLAGS)
# Check for AVX
if (MSVC)
if (NOT MSVC_VERSION LESS 1600)
@jollyjonson
jollyjonson / gist:1bd6042b92a8a56c54ca000d9d5ddb1f
Created October 31, 2023 13:17
Find the version of a package installed through apt
dpkg -l | grep <package_name>
@jollyjonson
jollyjonson / gist:5865ce94f4bf056ed264b2a3fffb046b
Created October 26, 2023 16:12
g++ version and the default C++ standard it compiles with
g++ -v && g++ -dM -E -x c++ /dev/null | grep -F __cplusplus
@jollyjonson
jollyjonson / gist:239338ac85a8fa10f5d4c8c53c06db0d
Created October 25, 2023 15:27
Favorite BetterBibTex citekey format
auth.lower + year + shorttitle(1, 1).lower
@jollyjonson
jollyjonson / gist:a0270090b7447c541e8780b5690f6c98
Last active February 26, 2024 14:23
uBlock Filters (LinkedIn, SO)
! Block the LinkedIn feed
www.linkedin.com##.scaffold-layout__main:matches-path(feed)
! Block all distracting elements of stackexchange/stackoverflow
stackexchange.com##.tex2jax_ignore.module
stackexchange.com##.ps-relative.js-freemium-cta
stackexchange.com##.mb16.s-anchors__grayscale.s-anchors.s-sidebarwidget__yellow.s-sidebarwidget
stackoverflow.com##.tex2jax_ignore.module
stackoverflow.com##.ps-relative.js-freemium-cta