Skip to content

Instantly share code, notes, and snippets.

View Algo-ryth-mix's full-sized avatar
🇦🇹

Raphael Baier Algo-ryth-mix

🇦🇹
View GitHub Profile
@Algo-ryth-mix
Algo-ryth-mix / json-patcher.py
Created May 12, 2022 14:34
out of 2 json files make one
import argh
import json
import io
## very simple json patcher
## make sure to pip install argh
@argh.arg('basefile',help='path to the file you want to patch')
@argh.arg('patchfile',help='path to the file you want to patch BASEFILE with')
def main(basefile: str, patchfile: str):
@Algo-ryth-mix
Algo-ryth-mix / range.hpp
Created July 7, 2021 15:55
Python like range for c++
/*
Copyright 2021 Raphael Baier
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@Algo-ryth-mix
Algo-ryth-mix / vs-exec.bat
Created February 23, 2021 11:28
vs-exec.bat
@echo off
rem Allows to call commands as if it was a vs-prompt by preceeding it with vs-exec
rem For instance `vs-exec cl main.cpp` to compile `main.cpp`
IF NOT DEFINED VS_BASE_PATH (
FOR /F "tokens=*" %%g IN ('vswhere -latest -property "installationPath"') do (SET VS_BASE_PATH=%%g)
)
IF NOT DEFINED IS_DEVENV (
🇦🇹Austria 4 minutes ago
🤒Active: 4,398
😌Recovered: 631,138
💀Deaths: 10,631
💉Tests: 44,110,345
@Algo-ryth-mix
Algo-ryth-mix / discord-midnight.js
Last active August 24, 2020 16:22
The seconds to midnight on the doomsday clock in a handy littel discord bot
/* see below for license (ISC) */
/* requires:
- discord.js ($ npm install discord.js)
- minutes-to-midnight ($ npm install minutes-to-midnight)
*/
const Discord = require('discord.js');
const client = new Discord.Client();
const m2m = require('minutes-to-midnight');
@Algo-ryth-mix
Algo-ryth-mix / close_enough.hpp
Last active March 2, 2021 21:36
checks if two floats are "close enough"
/**
* Copyright 2020 Raphael Baier
*
* 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:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
/**
* Copyright 2020 Raphael Baier
*
* 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:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
@Algo-ryth-mix
Algo-ryth-mix / pixl_sparse_set.hpp
Last active April 19, 2020 14:39
Generic Sparse Set implementation (WIP)
#pragma once
#include <deque>
#include <vector>
#include <type_traits>
#include "common.hpp"
//inspired by https://gist.github.com/sjgriffiths/06732c6076b9db8a7cf4dfe3a7aed43a