Skip to content

Instantly share code, notes, and snippets.

View Sam4uk's full-sized avatar
🚘
Focusing

Sam4uk Sam4uk

🚘
Focusing
View GitHub Profile
@Sam4uk
Sam4uk / main.cpp
Created April 25, 2025 20:44
Minimal cros_cppp
#include <iostream>
#if 1
#define ParseCLI(X, Y)
#endif
/** WINDOS */
#if defined(_WIN32)
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
/**
* @file main.cpp
* @author Sam4uk (sam4uk.site@gmail.com)
* @brief
* @version 0.1
* @date 2025-04-06
*
* @copyright Copyright © Sam4uk 2025 (Sam4uk.site@gmail.com)
*
*/
sudo apt-get update
sudo apt install iptables iptables-persistent -y
sudo iptables -L -n
for eachZTIP in 185.152.67.145 103.195.103.66 66.90.98.98 84.17.53.155 107.170.197.14 79.127.159.187;
do
sudo iptables -A OUTPUT -d ${eachZTIP} -j DROP;
sudo iptables -A INPUT -s ${eachZTIP} -j DROP;
done
sudo service netfilter-persistent save
sudo iptables -L -n
@Sam4uk
Sam4uk / .gitattributes
Created January 31, 2022 19:25 — forked from Voonder/.gitattributes
Sample of git config file (Example .gitconfig, .gitattributes, .gitignore)
# Auto detect text files and perform LF normalization
* text=auto
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
@Sam4uk
Sam4uk / gist:cdd90148c405a0a77e97a51d8659470e
Created October 28, 2021 09:33
Fast members with get & set methods /draft/
#define member(type, name) \
private: \
type _m_##name{}; \
\
public: \
type get_##name() const \
{ \
return _m_##name; \
} \
void set_##name(const type value_##name) \
{"version":1,"resource":"file:///home/demo/Kepler0.1/include/DoubleValue.hpp","entries":[{"id":"Lplw.hpp","timestamp":1670783204339},{"id":"pvTr.hpp","timestamp":1670783226595},{"id":"xLyo.hpp","timestamp":1670783446741}]}
The quick brown fox jumps over the lazy dog
Mykola Solyanko, [23.03.20 20:09]
#include <iostream>
template<typename T1, typename T2>
struct Pair {
T1 first;
T2 second;
void swap(Pair<T1, T2>& rhs) {
T1 tmp = first;
int inputInt(const char * prompt,
int m = std::numeric_limits<std::size_t>::min(),
int M = std::numeric_limits<std::size_t>::max())
{
int N;
for (;;) {
std::cout << prompt << " (целое от " << m << " до " << M << "): " << std::flush;
if ((std::cin >> N).good() && (m <= N) && (N <= M)) return N;
if (std::cin.fail()) {
std::cin.clear();
@Sam4uk
Sam4uk / gist:be709a15034865e975bde7c57a9a9136
Created March 3, 2020 16:45
Лекція про лямди
Mykola Solyanko, [02.03.20 20:04]
#include <iostream>
#include <functional>
bool More(int a, int b) {return a > b;}
bool Less(int a, int b) {return a < b;}
// typedef bool (*Comp) (int, int);