Skip to content

Instantly share code, notes, and snippets.

View Dich0tomy's full-sized avatar

Dich0tomy Dich0tomy

View GitHub Profile
@Dich0tomy
Dich0tomy / c-package-management.txt
Last active April 14, 2024 22:58
C(++) package management be like
U gotta get outta your house, do 10 jumping jacks, fly to USA to Chuj Avenue 92939,
we'll give you a pendrive with the source code, fly back home, plug that pendrive in,
HAHAH it's actually a usb killer we got u good, anyway come back to Chuj Avenue,
we'll give you another pendrive (if you don't have another computer then skill issue lmaoooooo),
copy that source code to proper paths and build it as if it was part of your source code, system, hardware and life and not an external package
(btw did we tell you that the soruce code expects 92 files, 18 libraries, 4 configurations and a specific cpu to be in place?),
ah, and if we have another version you have to fly back to USA, tho we dont guarantee we will be on Chuj Avenue this time u gotta ask the locals LOLOLOL
# Some ol' good #rant
@Dich0tomy
Dich0tomy / starship.toml
Last active August 4, 2022 21:54
My starship format.
format = """
$directory[$git_branch](fg:#a2a9b0) [::](fg:#08bdba)$character
"""
[directory]
truncation_length = 1
format = "[$path]($style)[$read_only]($read_ony_style)"
style = "fg:#78a9ff"
read_only = "[RO]"
read_only_style="fg:#393939"
@Dich0tomy
Dich0tomy / test.cpp
Created July 8, 2022 21:23
A simple C++11 detection idiom presented.
#include <type_traits>
#include <iostream>
#include <utility>
namespace mystd {
namespace detail {
template <typename...>
using void_t = void;
@Dich0tomy
Dich0tomy / .clang-format
Last active June 18, 2023 21:52
My clang format, some stuff is commented out since my latest clang-format is 15.x.x
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: None
AlignEscapedNewlines: DontAlign
#include <iostream>
#include <cstring>
#include <cstddef>
#include <string>
namespace impl {
template <typename Type>
auto swap(Type& first, Type& second) -> void {
std::cout << "No swap :(";
@Dich0tomy
Dich0tomy / windows-create-process-pipes.cpp
Last active August 8, 2022 07:31
CreateProcess with pipes, reading from process stdout.
#include <Windows.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <array>
auto main(int argc, char** argv) -> int {
using pipe_handle = void*;
auto stdout_read = pipe_handle(); // not needed
@Dich0tomy
Dich0tomy / shit.cpp
Last active August 25, 2021 19:42
An incredibly simple thing that let's you make nested templates sheesh right
template <template <typename...> typename Template, std::size_t Size, typename... Type>
struct make_nested {
using internal = Template<typename make_nested<Template, Size-1, Type...>::internal>;
};
template <template <typename...> typename Template, typename... Type>
struct make_nested<Template, 1, Type...> {
using internal = Template<Type...>;
};
@Dich0tomy
Dich0tomy / argsc.cpp
Created June 5, 2021 00:58
Quickly implemented callable arguments counting (C++20).
#include <iostream>
#include <type_traits>
#include <iostream>
#include <cstddef>
#define MAKE_REMOVE_MEM_FN_CV_SPEC(...) \
template <class_type Class, typename Ret, typename... Args> \
struct remove_mem_fn_cv<auto (Class::*)(Args...) __VA_ARGS__ -> Ret> { \
using type = auto (Class::*)(Args...) -> Ret; \
};
// THIS WORK IS NOT MINE, IT'S dysmal's WORK FROM Together C & C++ server
// THIS PIECE OF CODE WAS PRESENTED TO ME BY dysmal FROM "Together C & C++" discord server. I'VE NOT PARTICIPATED IN THE PROCESS OF ITS CREATION
#define aSet c
#define BufferedReader(x)1
#define byte Y[I][_^1]?do(:):_&1?do(.):do(`):8;++y;}
#define class int N=0,_,O=328,l=192,y=4,Y[80][64]={0},I;struct
#define do(c)a(#c "\b")
#define err c,c
#define getAllStrings(x));q()