Skip to content

Instantly share code, notes, and snippets.

View C0nsultant's full-sized avatar

Fabian Koller C0nsultant

  • Dresden, Germany
View GitHub Profile
@C0nsultant
C0nsultant / JackClient.cpp
Last active January 19, 2021 17:34
JACK2 SEGFAULT with repeated client names
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include "JackClient.h"
JackClient::JackClient(
@C0nsultant
C0nsultant / nginx.conf
Last active October 16, 2019 18:25
Basic single-site nginx SSL reverse proxy with https upgrade
events {
multi_accept on;
worker_connections 65535;
}
http {
charset utf-8;
sendfile on;
tcp_nopush on;
tcp_nodelay on;

Pessimit's Guide to Review Feedback

By following the advice in this guide, you will become the most dreaded reviewer all around. You will consistently waste not only your own time, but also that of the author. You will learn to leave the most frustrating feedback on those pesky reviews for work that is subpar to your sublime craftsmanship.

Should you catch yourself applying a significant number of these anti-patterns during a review, STOP THE PROCESS IMMEDIATELY. Occupy yourself with whatever task you can tackle in a more satisfactory way. Come back when you are in the right mindset and start the process over. Delaying the feedback to improve its quality is worth the wait. There counter-intuitively will be less time wasted and less frustration felt on both sides.

@C0nsultant
C0nsultant / CMakeList.txt
Created September 19, 2017 13:42
Manually lniking static libraries in CMake
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
PROJECT(Code)
ADD_LIBRARY(libmysqlcppconn STATIC IMPORTED)
SET_PROPERTY(TARGET libmysqlcppconn PROPERTY IMPORTED_LOCATION /usr/lib/libmysqlcppconn.so.7)
ADD_EXECUTABLE(exec main.cpp)
TARGET_LINK_LIBRARIES(exec libmysqlcppconn)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@C0nsultant
C0nsultant / scalar.cpp
Created August 29, 2017 13:23
Writing scalar openPMD recrod
#include "include/Output.hpp"
int main(int argc, char *argv[])
{
Output o("./working/directory/",
"file_name",
Output::IterationEncoding::fileBased,
Format::HDF5,
AccessType::CREAT);
@C0nsultant
C0nsultant / metapow.hpp
Last active December 10, 2016 18:40
C++ header to calculate pow(B,E) at compiletime in O(log(E))
#pragma once
#if __cplusplus > 199711L
#include <cstdint>
constexpr uint64_t pow_impl(uint64_t B, uint64_t E, uint64_t res = 1)
{
return E < 1 ? res : pow_impl(B*B, E/2, E%2 ? B*res : res);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.