In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
| # generate private key | |
| openssl genrsa -out private.pem 2048 | |
| # extatract public key from it | |
| openssl rsa -in private.pem -pubout > public.pem |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <netdb.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <sys/epoll.h> | |
| #include <errno.h> |
| #!/usr/bin/env python | |
| try: | |
| import gdb | |
| inside_gdb = True | |
| except ImportError: | |
| inside_gdb = False | |
| if inside_gdb: |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <fcntl.h> | |
| #include <sys/stat.h> | |
| #include <sys/mman.h> | |
| #include <unistd.h> | |
| int main(int argc, const char *argv[]) | |
| { |
| #include <iostream> | |
| #include <chrono> | |
| #include <ctime> | |
| #include <cmath> | |
| class Timer | |
| { | |
| public: | |
| void start() | |
| { |
| // Sample custom iterator. | |
| // By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558) | |
| // From: http://www.dreamincode.net/forums/index.php?showtopic=58468 | |
| #include <iostream> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <iterator> | |
| #include <cassert> |
| #include <iostream> | |
| #include <istream> | |
| #include <ostream> | |
| #include <boost/asio.hpp> | |
| #include <boost/asio/spawn.hpp> | |
| class client { | |
| public: | |
| client(boost::asio::io_service& io_service, const std::string& server, const std::string& path) | |
| : resolver_(io_service), socket_(io_service) { |