Skip to content

Instantly share code, notes, and snippets.

View sonneveld's full-sized avatar

Nick Sonneveld sonneveld

  • Canberra, Australia
View GitHub Profile
@mbinna
mbinna / effective_modern_cmake.md
Last active May 3, 2024 15:44
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@cschiewek
cschiewek / x11_docker_mac.md
Last active May 2, 2024 17:53
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@outbreak
outbreak / uuid.js
Created October 25, 2016 17:39
UUID v4 JavaScript implementation with window.crypto.getRandomValues()
function uuid () {
function getRandomSymbol (symbol) {
var array;
if (symbol === 'y') {
array = ['8', '9', 'a', 'b'];
return array[Math.floor(Math.random() * array.length)];
}
array = new Uint8Array(1);