Skip to content

Instantly share code, notes, and snippets.

View DBJDBJ's full-sized avatar
😬
Can't stop coding

dbj DBJDBJ

😬
Can't stop coding
View GitHub Profile
@DBJDBJ
DBJDBJ / line_noise_convert_utf.h
Created April 9, 2020 21:19
unicode conversions
#pragma once
#ifndef LINENOISE_CONVERT_INC
#define LINENOISE_CONVERT_INC
/*
Copyright 2020 dbj@dbj.org -- turned into single header C lib
inevitably some name clashes will
start becuase of this header.
Thus renaming is very likely not finished
Licence: CC BY SA 4.0
@DBJDBJ
DBJDBJ / clean_all_the_linked_in_connections.md
Last active December 16, 2022 18:16
Clean All Your Linked IN Connections With A Script

Very big Warning:

If you do not know (or have a faintest clue) what is "Chrome Dev Console" please do not attempt deleting your LinkedIN connections using the script presented here.

Please consider purchasing a very powerfull but user friendly LINKED IN HELPER.

Or find a friend who can understand this text. Or just give up until you do. If not sure what are you doing here, please do not try on your own, anything described. Just leave.

Script to delete ALL connections on your LinkedIN account

@DBJDBJ
DBJDBJ / lambda_powered matrix.h
Last active March 14, 2020 16:26
C++ lambda powered matrix
#pragma once
// (c) 2019-2020 by dbj@dbj.org
// License: CC BY SA 4.0
#include <iomanip> // setw
#include <sstream>
#include <array>
#include <cassert>
#include <string>
#include <vector>
@DBJDBJ
DBJDBJ / dbj_meta_converter.h
Last active April 4, 2020 11:45
nicely and quickly transform any std range made of std chars into std string of your choice -- only ASCII part that is
#ifndef _DBJ_META_CONVERTER_INC_
#define _DBJ_META_CONVERTER_INC_
/*
(c) 2019/202 by dbj@dbj.org
LICENCE -- CC BY SA 4.0 -- https://creativecommons.org/licenses/by-sa/4.0/
This tool transforms any kind of char range into any required string kind.
By kind we mean "made of particular char type"
See the comprehensive testing in a separate header also here.
NOTE: be forewarned: in C++20 char8_t is actually crippled.
@DBJDBJ
DBJDBJ / fmt_format_to_vs_buffers_used.cpp
Created November 6, 2019 15:31
testing {fmt} fmt::format_to() vs the buffer used
/*
(c) 2019/2020 by dbj@dbj.org, LICENCE CC BY SA 4.0
Compiled using Visual Studio 2019 with CLANG 8.0.1
Machine Win10 PRO, CPU i5, 8 GB RAM
-----------------------------------------------------------
Typical Results:
-----------------------------------------------------------
// 2019=05-13 dbj@dbj.org
//
// clang++ prog.cc -Wall -Wextra -std=c++17
//
#include <iostream>
#include <string_view>
#include <type_traits>
using namespace std;
using namespace std::string_view_literals ;
@DBJDBJ
DBJDBJ / dbj_string_trim.cpp
Last active September 22, 2018 04:21
fast string trim with C++17 usage
/*
Copyright 2018 by dbj@dbj.org
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http ://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@DBJDBJ
DBJDBJ / coroutine-simple.cpp
Last active September 6, 2018 13:32 — forked from yizhang82/coroutine-simple.cpp
Simple C++ coroutine example
/*
until C++20 to build this with CL (MSVC)
/await compiler switch is required
*/
#include <future>
#include <iostream>
#ifndef __cpp_coroutines
@DBJDBJ
DBJDBJ / dbj_swappable_engines.h
Created June 6, 2018 20:52
Swappable Engine Factory, I think a better variation to the Factory Pattern
#pragma once
/*
Swappable Engine Factory, I think a better variation to the
Factory Pattern
Usage:
using namespace car_factory;
auto car_1 =
@DBJDBJ
DBJDBJ / linux_demangler_for_clang_and_gcc.h
Last active August 6, 2021 08:07
C++ linux demangler for clang ang gcc
/*
(c) 2018-2021 by dbj@dbj.org -- https://dbj.org/license_dbj
usage:
auto demangled_name = dbj::demang< int (&) [42] >() ;
This is both windows and linux code.
https://godbolt.org/z/7bTxazhTv
*/
#ifndef _WIN32