Skip to content

Instantly share code, notes, and snippets.

@rioki
rioki / ObjParser.cpp
Created January 26, 2018 18:36
OBJ Parser
//
// OBJ Parser
//
// Copyright (c) 2014 Sean Farrell
//
// 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
#include <stdio.h>
#include "test.h"
int register_parse_tests();
int main(int argc, char*argv[])
{
int r = 0;
r = register_parse_tests();
// Copyright 2019 Sean Farrell <sean.farrell@rioki.org>
// This work is free. You can redistribute it and/or modify it under the
// terms of the Do What The Fuck You Want To Public License, Version 2,
// as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#ifndef _ROUND_ROBIN_H_
#define _ROUND_ROBIN_H_
#include <array>
// PID Controller
// Copyright 2017 Sean Farrell <sean.farrell@rioki.org>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What The Fuck You Want
// To Public License, Version 2, as published by Sam Hocevar.
// See http://www.wtfpl.net/ for more details.
#include "PidController.h"

Supergenpass Command Line Interface

This is short CLI to run supergenpass, for when the website is down.

License

This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want

To Public License, Version 2, as published by Sam Hocevar. See

@rioki
rioki / iterator_wrapper.h
Created April 25, 2022 13:24
Iterator wrapper that allows to use two iterators in range based for loop.
template <typename T>
struct iterator_wrapper
{
iterator_wrapper(T&& begin, T&& end) noexcept
: m_begin{std::forward<T>(begin)}, m_end{std::forward<T>(end)} {}
const T& begin() const noexcept
{
return m_begin;
}
@rioki
rioki / one_of.h
Created April 26, 2022 07:39
one_of: a small piece of code that removes switch on enum statements.
template <typename EnumT> constexpr
bool one_of(EnumT value, const std::initializer_list<EnumT>& checkValues)
{
for (const auto& cv : checkValues)
{
if (value == cv)
{
return true;
}
}
@rioki
rioki / opt-gtest.h
Created June 6, 2022 18:08
Better Google Test Support for std::optional.
// std gtest comparators
// Copyright 2022 Sean Farrell <sean.farrell@rioki.org>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What The Fuck You Want
// To Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
#pragma once
name: Auto approve
on:
issue_comment:
types:
- created
jobs:
auto-approve:
runs-on: ubuntu-latest
@rioki
rioki / CrashWatchdog.cpp
Created April 4, 2023 07:48
CrashWatchdog
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What The Fuck You Want
// To Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
#include "CrashWatchdog.h"
#include <stdexcept>
#include <array>