Skip to content

Instantly share code, notes, and snippets.

View simonrenger's full-sized avatar

Simon Renger simonrenger

View GitHub Profile
@simonrenger
simonrenger / memoy_managment_cpp_resource_list.md
Last active May 5, 2024 09:06
C++ Memory Management Resource List
@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 <simon.renger@gmail.com>
# 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
#!/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 / 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...
@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> {