Skip to content

Instantly share code, notes, and snippets.

View simonrenger's full-sized avatar

Simon Renger simonrenger

View GitHub Profile
@simonrenger
simonrenger / tupletotype.h
Last active December 27, 2018 14:33
C++ Tuple to type generation
#include <tuple>
///////////////////////////////////////////////// TUPLE GENERATOR /////////////////////////////////////////////////
template <unsigned int N, typename T>
struct TupleGenerator {
using type = decltype(std::tuple_cat(std::tuple<T>(), typename TupleGenerator<N - 1, T>::type()));
};
template <typename T>
struct TupleGenerator<0, T> {
@simonrenger
simonrenger / alloc.h
Created March 10, 2019 21:25
chained allocator based on Variadic templates
#include <tuple>
//#include "memory/Allocator.h"
struct Blk
{
void* ptr;
std::size_t size;
};
template<typename ...Args>
class Alloc : public Args...
#!/bin/bash
echo "License Append script"
license=$1
ending=$2
folder=*
file=""
scan_for_folders(){
for i in $folder; do
if [ -d $i ]
then
@simonrenger
simonrenger / pab_hugo.sh
Created November 18, 2019 17:35
Pull & Build a hugo repositry and move to destination
#!/bin/bash
# Author: Simon Renger <[email protected]>
# This script will pull and build your Hugo website from a git server and then build it and move to the correct location.
# Simple usage:$ sh pb_hugo.sh <reponame> <folder name> <move location>
# example: sh pb_hugo.sh https://gitserver.tld/user/my-blog.git my-blog /home/user/www/
if [ ! -d $2 ]
then
echo "Clone repo and build"
git clone $1 $2 && cd $2 && hugo && mv public $3
else
@simonrenger
simonrenger / memoy_managment_cpp_resource_list.md
Last active November 2, 2024 12:24
C++ Memory Management Resource List