Skip to content

Instantly share code, notes, and snippets.

@matthewelmer
matthewelmer / pretty_print.hxx
Created November 17, 2023 08:03
`operator<<` overload for `std::array` and `std::vector`
#pragma once
#include <array>
#include <cmath>
#include <vector>
#include <iomanip>
#include <ostream>
using std::ostream;
using std::ios_base;
@matthewelmer
matthewelmer / cgl.jl
Last active October 9, 2023 08:04
Exemplary Julia Code (p3.jl, the others are included just in case you want to try running it)
module CGL;
export cgl;
using Revise; # you must do this before loading any revisable packages
function cgl(n::Integer)::Vector{Real}
# Returns n cgl points on the closed interval [-1, 1].
return @. cos(pi * ((1:n) - n) / (n - 1));
end
@matthewelmer
matthewelmer / Makefile
Last active September 22, 2023 08:21
simpler makefile
# MIT License
#
# Copyright (c) 2023 Matthew Elmer
#
# 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:
@matthewelmer
matthewelmer / Makefile
Last active July 1, 2023 03:06
Makefile with automatic dependency generation and build vs release modes
# MIT License
#
# Copyright (c) 2023 Matthew Elmer
#
# 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:
@matthewelmer
matthewelmer / mailbox.org calendar resizer
Last active October 14, 2022 03:23
Makes the calendar actually visible instead of horrendously zoomed in.
// MIT License
//
// Copyright (c) 2022 Matthew Elmer
//
// 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: