Skip to content

Instantly share code, notes, and snippets.

View VeganPower's full-sized avatar
🕹️

Rosario VeganPower

🕹️
  • London, UK
View GitHub Profile
@VeganPower
VeganPower / cpp
Last active March 30, 2022 13:49
--- fileA.h ---
struct Singleton()
{
static Singleton* Get()
{
static Singleton the_instance;
return &the_instance;
}
#include <benchmark/benchmark.h>
#include <vector>
#include <algorithm>
size_t linear_search(int* buffer, size_t count, int to_find)
{
#if 1
const size_t batch = 0;
size_t count_4 = 0;
#else
@VeganPower
VeganPower / c++Course.md
Created August 30, 2020 12:12
Low level programming in C++

Reference CPU: Multicore AVX 2 capable

Lets' start:

  • Compiler / compile units / linker.
    • Setup makefile
  • Imperative algorithm
  • Understand our processor
  • bit/byte/word/dword/qword
@VeganPower
VeganPower / filter.hpp
Last active May 5, 2018 14:45
operator = inheritance
#pragma once
#include <type_traits>
#include <functional>
#include "function_traits.hpp"
template<typename T>
struct ViewTraits
{
typedef decltype(std::declval<T>().read()) ViewValue_t;
@VeganPower
VeganPower / Lamp.cpp
Created July 24, 2017 22:48
reply to /u/TheGoodPlaceJanet
class UsbLampManager : public LampManager
{
bool switch_lamp(bool turn_on) override;
};
class BluetoothLampManager : public LampManager
{
bool switch_lamp(bool turn_on) override;
};