Skip to content

Instantly share code, notes, and snippets.

View marc0x71's full-sized avatar
🤪

marc0x71 marc0x71

🤪
View GitHub Profile
@marc0x71
marc0x71 / gist:076c36c1fb9ad640670ed47a020f6d02
Created June 1, 2024 21:19 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@marc0x71
marc0x71 / exec.py
Created May 8, 2024 17:57
Execute the external command in Python
import shlex
from subprocess import Popen, PIPE
def get_exitcode_stdout_stderr(cmd: str):
"""
Execute the external command and get its exitcode, stdout and stderr.
"""
args = shlex.split(cmd)
@marc0x71
marc0x71 / myclass.cpp
Created January 27, 2023 17:38
C++ Rule of Five
class myclass {
public:
myclass()=default;
myclass(const myclass &) = default;
myclass(myclass &&) = default;
myclass &operator=(const myclass &) = default;
myclass &operator=(myclass &&) = default;
~myclass() = default;
};
ColumnLimit: 120
Cpp11BracedListStyle: false
IndentWidth: 4
Standard: Auto
TabWidth: 4
UseTab: ForIndentation
@marc0x71
marc0x71 / singleton.cpp
Created December 27, 2022 09:55
Modern C++ singleton
#include <iostream>
class singleton_interface {
public:
virtual ~singleton_interface() = default;
virtual void do_something() const = 0;
};
class singleton : public singleton_interface {
public:
@marc0x71
marc0x71 / recursive_directory_finder.cpp
Created July 2, 2022 15:36
Recursive directory file finder
void filelist(const std::string& path, const std::string& match_str, std::function<void(std::string, std::string)> f) {
std::regex re(match_str);
auto it = std::filesystem::recursive_directory_iterator(path, std::filesystem::directory_options::skip_permission_denied);
auto it_end = std::filesystem::end(it);
while (it != it_end) {
try {
auto dir_entry = *it;
if (dir_entry.is_regular_file()) {
auto filename = dir_entry.path().filename().string();
auto folder = dir_entry.path().parent_path().string();
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
curl -sSL https://get.haskellstack.org/ | sh
@marc0x71
marc0x71 / docker.md
Last active February 20, 2021 18:21
Comandi Docker

Docker

Comandi utili

docker version

docker run hello-world

docker ps
@marc0x71
marc0x71 / Fask grep -vf
Last active November 9, 2020 08:33
Fast grep -vf
awk 'FNR==NR {hash[$0]; next} !($0 in hash)' file-piccolo file-grande
@marc0x71
marc0x71 / extract-a-predetermined-range-of-lines-from-a-text-file.bash
Created October 9, 2018 14:29
Extract a predetermined range of lines from a text file
sed -n 100,200p filename