This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// Suppress warnings for AMQP-CPP | |
#if defined(__clang__) | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wunused-parameter" | |
#pragma clang diagnostic ignored "-Wclass-conversion" | |
#pragma clang diagnostic ignored "-Wdeprecated-copy" | |
#include <amqpcpp.h> | |
#include <amqpcpp/libev.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
set -e | |
model="gpt-4-turbo-preview"; | |
temperature=0.8; | |
prompt="Here is the output of \`git log <latest_tag>..HEAD\`. Please provide the perfect tag message."` | |
`" Use emjoi if it is possible. Use past tense. "` | |
`"Provide a message ready for direct substitution "` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
set -e | |
model="gpt-4-turbo-preview"; | |
temperature=0.8; | |
prompt="Here is the output of \`git diff HEAD\`. Please provide the perfect commit message."` | |
`" Use emjoi if it is possible. Use past tense in the title. "` | |
`"(# If there is an error in the code, report it in the comments to the commit please)." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
// true if current user is not root | |
// or true if owner changing is not required (targ_uid == 0) | |
// or true if current user is root and uid changed | |
// false otherwise (owner changing was unsuccessful) | |
bool change_owner(unsigned int targ_uid) noexcept | |
{ | |
return | |
(0u != getuid()) || // made sure that src_uid == 0 (source is root) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <event2/bufferevent.h> | |
#include <event2/buffer.h> | |
#include <event2/listener.h> | |
#include <event2/util.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: fixdell | |
# Required-Start: $local_fs $syslog $named | |
# Required-Stop: $local_fs $syslog $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Fix DELL freezes | |
# Description: startup script for Fix DELL freezes | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
#include <chrono> | |
struct BenchResult | |
{ | |
std::chrono::nanoseconds duration; | |
double sum; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <utility> | |
#include <vector> | |
// Равномерно разделяет диапазон значения | |
// Для балансировки нагрузки на ядра CPU | |
std::vector<std::pair<int, int>> | |
splitRange(int from, int to, uint threads) noexcept | |
{ | |
std::vector<std::pair<int, int>> pairs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT := $(notdir $(CURDIR)) | |
EXCECUTABLE = $(BUILDDIR)/$(PROJECT) | |
# Directories specification | |
SRCDIRS := src | |
INCDIRS := include | |
BUILDDIR := build | |
# @note: to add another source extension, add to herer AND make sure to | |
# write the " $(BUILDDIR)/%.o: %.ext " rule for this extention in order to work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if constexpr to switch type | |
// | |
template<uint8_t N> | |
struct _buf_type | |
{ | |
static_assert(N > 0, "Buffer must be more then 0"); | |
static_assert(N <= 64, "Maximum buffer size is 64"); | |
constexpr static auto _i2t() | |
{ | |
if constexpr (N <= 8 ) {return uint8_t(0) ;} |
NewerOlder