Skip to content

Instantly share code, notes, and snippets.

View johnmcfarlane's full-sized avatar

John McFarlane johnmcfarlane

View GitHub Profile
@johnmcfarlane
johnmcfarlane / cnl_complete_17_128bit.h
Last active May 13, 2019 00:22
Single-header CNL library for C++17 with 128-bit integer support
// Copyright John McFarlane 2018.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file ../LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// mechanically retrieved, single-header version of CNL library
// https://github.com/johnmcfarlane/cnl
#if ! defined(CNL_COMPLETE_H)
@johnmcfarlane
johnmcfarlane / begin(C++).md
Last active April 7, 2024 00:54
Resources for C++ beginners
@johnmcfarlane
johnmcfarlane / constant.md
Last active October 13, 2017 20:03
Draft proposal for addition of `std::constant`

Document number: DXXXXR0
Date: 2017-09-19
Reply-to: John McFarlane, cnl@john.mcfarlane.name
Reply-to: Louis Dionne, ldionne.2@gmail.com
Audience: SG6, SG14, LEWG

General-Purpose Constant Value Type

Introduction

http://archive.computerhistory.org/resources/access/text/2012/06/102746190-05-01-acc.pdf

Wilson: So that was 1981. We converted a lot of the system range capabilities to make the BBC machine [the BBC Micro] in the first place, and we built a lot of peripherals specifically for the BBC machine. And then we started implementing language processors. So the BBC machine had a socket underneath of it for the second processor, and its two-processor model. I designed the Tube, interconnection between the two things, and wrote all the software protocols that ran the Tube. The Tube was basically a dual-direction DMA controller plus four FIFO channels of communication so that you could virtualize your operating system. So a second processor operating system, all they had to do was send the right commands across the Tube, and the I/O processor machine would do all the right stuff for them. So we got all of that

@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 10, 2024 09:12
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@larsch
larsch / PrecompiledHeader.cmake
Last active March 12, 2022 10:49
cmake module for setting up precompiled headers (MSVC & GCC)
# Function for setting up precompiled headers. Usage:
#
# add_library/executable(target
# pchheader.c pchheader.cpp pchheader.h)
#
# add_precompiled_header(target pchheader.h
# [FORCEINCLUDE]
# [SOURCE_C pchheader.c]
# [SOURCE_CXX pchheader.cpp])
#