This file contains hidden or 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
#!/usr/bin/rdmd --shebang= -I. -w -debug -g | |
// | |
// multithreading find and execute | |
// | |
/* | |
ldc2 -O3 -dw -release -w -boundscheck=off -fvisibility=hidden -c find_mt.d -of=find_mt.o && \ | |
ldc2 -O3 -dw -release -w -link-defaultlib-shared=false -L-l:libphobos2-ldc.a -L-l:libdruntime-ldc.a -L-l:libz.a find_mt.o -of=find_mt && \ | |
strip --strip-all find_mt && \ |
This file contains hidden or 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) ;} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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-4o"; | |
temperature=0.8; | |
prompt="Below is the output of \`git diff HEAD\`."` | |
`"\nPlease provide a perfect git commit message."` | |
`"\nAlways use an emoji as the first character. Use emojis in the message text when appropriate."` |
This file contains hidden or 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-4o" | |
temperature=0.8 | |
prompt="Below is the output of \`git log <latest_tag>..HEAD\`."` | |
`"\nPlease provide a perfect tag message."` | |
`"\nUse emojis in the message text when appropriate. Use past tense."` |