Skip to content

Instantly share code, notes, and snippets.

@m-pilia
m-pilia / init.lua
Last active October 27, 2024 14:32
Neovim 0.11 built-in LSP autocompletion
-- Built-in autocompletion
local lsp_au_group = vim.api.nvim_create_augroup('lsp_au_group', {clear = true})
vim.api.nvim_create_autocmd({'LspAttach'}, {
callback = function()
local clients = vim.lsp.get_clients()
for _, client in ipairs(clients) do
local id = client.id
vim.lsp.completion.enable(true, id, 0, {autotrigger = true})
end
end,
@m-pilia
m-pilia / CMakeLists.txt
Last active June 9, 2022 20:57
Catch2 death test (fork)
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_STANDARD 17)
project(catch2_death_test_example LANGUAGES CXX VERSION 0.0.1)
include(FetchContent)
FetchContent_Declare(
Catch2
@m-pilia
m-pilia / CMakeLists.txt
Last active February 24, 2024 05:47
FakeIt + Catch2 example
cmake_minimum_required(VERSION 3.5)
project(fakeit_example LANGUAGES CXX VERSION 0.0.1)
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.1
@m-pilia
m-pilia / gp_posterior_sampling.jl
Created November 14, 2019 10:39
Example sampling of a Gaussian Process posterior
using Distributions
using LinearAlgebra
using Plots
using Random
pyplot();
# Training points
P = [
1.0 1.0
@m-pilia
m-pilia / gp_prior_sample.jl
Created November 13, 2019 13:44
Example sampling from a Gaussian Process prior
using Distributions
using LinearAlgebra
using Plots
using Random
pyplot();
N = 500;
M = 5;
ϵ = 1e-6 * rand() * I;