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 <map> | |
| #include <algorithm> | |
| #include <functional> | |
| #include <memory> | |
| using namespace std; | |
| class EventArgs { | |
| public: |
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
| # Redis Cheatsheet | |
| # All the commands you need to know | |
| redis-server /path/redis.conf # start redis with the related configuration file | |
| redis-cli # opens a redis prompt | |
| # Strings. |
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
| /* | |
| This a header file that includes every standard library. | |
| You can use it to save time. | |
| NOTE: This header file may not be recognized by compilers | |
| other than gcc. | |
| */ | |
| #include <bits/stdc++.h> | |
| /* | |
| //Use this if the above header file doesn't 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 <bits/stdc++.h> | |
| using namespace std; | |
| struct node { | |
| int data{}; | |
| node* left = nullptr; | |
| node* right = nullptr; | |
| node* parent = nullptr; | |
| string color; | |
| }; |
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 <chrono> | |
| auto start = std::chrono::high_resolution_clock::now(); | |
| // Code to time | |
| auto finish = std::chrono::high_resolution_clock::now(); | |
| double duration = std::chrono::duration_cast<std::chrono::milliseconds>(finish - start).count(); |
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
| // usage | |
| std::vector<std::string> exts{".jpg", ".png"}; | |
| std::vector<std::string> files = getFilesInDir("/path/to/root/directory/", exts, true); | |
| // -------------------------------------------------------- | |
| #define BOOST_FILESYSTEM_NO_DEPRECATED | |
| #include <boost/filesystem.hpp> |
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 <math.h> | |
| using namespace std; | |
| template <class T> | |
| struct Node { | |
| T value; | |
| Node *left; | |
| Node *right; |

