Skip to content

Instantly share code, notes, and snippets.

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 / sdl2test.c
Created April 9, 2015 19:47
Test of SDL2 main loop.
#include <stdio.h>
#include <SDL.h>
#include <SDL_image.h>
#include <Windows.h>
#include <time.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
const int WIDTH = 640;
const int HEIGHT = 480;
@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>
//
// 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
// furnished to do so, subject to the following conditions:
//
@rioki
rioki / autosync.js
Last active October 26, 2023 17:58
Automatically sync two directories with node.js.
var fs = require("fs");
var path = require("path");
var configFile = "autosync.json";
if (process.argv.length == 3) {
configFile = process.argv[2];
}
var config = JSON.parse(fs.readFileSync(configFile, "UTF-8"));
@rioki
rioki / dbg.h
Created January 9, 2017 10:51
Debug Helpers
//
// Debug Helpers
//
// Copyright (c) 2015 - 2017 Sean Farrell <sean.farrell@rioki.org>
//
// 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