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 <type_traits> | |
// ---------------- Исходные типы | |
// Структура используется только как хранилище типов | |
// Наверняка можно сделать так, чтобы её можно было сделать | |
// только внутри declspec, но зачем нам троллейбус из буханки, | |
// и так непросто вышло | |
template <typename... Ts> |
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
cmake_minimum_required(VERSION 3.0.0) | |
project(unclean VERSION 0.1.0) | |
set (CMAKE_CXX_STANDARD 17) | |
add_executable(shape_bench main.cpp) |
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
// ==UserScript== | |
// @name Notabenoid bbcode shortkey | |
// @namespace http://notabenoid.zapto.org/ | |
// @version 0.1 | |
// @description enter something useful | |
// @match http://notabenoid.zapto.org/* | |
// @copyright 2019, [email protected] | |
// ==/UserScript== | |
function changeSel(chr) // javascript |
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 <fstream> | |
#include <iostream> | |
#include <string> | |
void writeppm(char const * const image_buffer, | |
int const image_size, | |
int const width, | |
int const height, | |
std::string const filename){ | |
std::ofstream file{filename, std::ios::binary}; |
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
# https://unix.stackexchange.com/a/384513 | |
# by | |
# https://unix.stackexchange.com/users/10349/ysdx | |
hostname@user:~$ nmcli d | |
DEVICE TYPE STATE CONNECTION | |
wlp3s0 wifi connected InternetSSID | |
wlx8416f91eade2 wifi disconnected -- #your future AP | |
enp2s0 ethernet unavailable -- |
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
struct SaveableData{ | |
uint32_t update_counter; | |
}; | |
struct UploadSafe{ | |
char dummy[64]; | |
uint32_t flag; | |
//Unless more than 64 bytes of global/static variables | |
//added/removed this will be saved | |
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/true;COMPILER_OPTIONS="-std=c99 -g -Wall -Wextra -O0";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $COMPILER_OPTIONS -xc "$THIS_FILE" -o "$OUT_FILE" || exit;exec "$OUT_FILE" "$@" | |
///bin/true;COMPILER_OPTIONS="-g -Wall -Wextra --std=c11 -O3 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $COMPILER_OPTIONS -xc "$THIS_FILE" -o "$OUT_FILE" || exit;exec "$OUT_FILE" "$@" | |
// For windows dwellers like me, this will totally work in MSYS2, and most likely in Cygwin and MSYS. | |
// MSYS2 is better, though. | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define xstr(a) str(a) | |
#define str(a) #a |
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> | |
class ContinuousAngle { | |
public: | |
auto &reset() { | |
trimmed_angle_ = 0; | |
turns_ = 0; | |
return *this; | |
} | |
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
//example: | |
//multiprint("I = ")(10)("A")()("U = ")(10)("V")(); | |
//result: | |
//I = 10A | |
//U = 20V | |
// | |
//arguments -- same as Serial.print | |
//no argument -- Serial.println() | |
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
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 | |
#include <iostream> | |
void multiprint(){ | |
static constexpr size_t base = __COUNTER__; | |
#define i (__COUNTER__ - base - 1) | |
std::cout << i << std::endl; | |
std::cout << i << std::endl; | |
std::cout << i << " " << i <<std::endl; |
NewerOlder