Skip to content

Instantly share code, notes, and snippets.

View dylanliuh2o's full-sized avatar
📚
Try my best.

dylanliuh2o dylanliuh2o

📚
Try my best.
View GitHub Profile
@dylanliuh2o
dylanliuh2o / CMakeLists.txt
Last active May 31, 2024 02:47
Mode Maintainable Cpp String Conversion
cmake_minimum_required(VERSION 3.20)
project(string_conversion_exception)
set(CMAKE_CXX_STANDARD_REQUIRED 17)
find_package(Boost 1.74 REQUIRED)
if (Boost_FOUND)
message("Boost found")
@dylanliuh2o
dylanliuh2o / dir_manager.cc
Last active April 11, 2024 09:55
Central Directory Manager
#include <string>
#include <filesystem>
#include <map>
namespace fs = std::filesystem;
const std::map<std::string, fs::path> dirs {
{ "WorkDir", fs::path("work_dir") },
{ "SMT-FileDir", fs::path("work_dir/smt") },
{ "Logs", fs::path("work_dir/log") },
@dylanliuh2o
dylanliuh2o / main.cc
Last active July 4, 2023 17:03
simple cli program framework
#include <iostream>
#include <format>
#include <string>
#include <vector>
#include <map>
struct Pass;
std::map<std::string, Pass*> pass_register;
@dylanliuh2o
dylanliuh2o / proxy.sh
Created June 23, 2023 10:43
WSL2-proxy-config
#!/bin/sh
hostip=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')
wslip=$(hostname -I | awk '{print $1}')
port=7890
PROXY_HTTP="http://${hostip}:${port}"
set_proxy(){
export http_proxy="${PROXY_HTTP}"
export HTTP_PROXY="${PROXY_HTTP}"
@dylanliuh2o
dylanliuh2o / evalexpr.cc
Created June 15, 2023 14:37
evaluate expression contains @ and $
#include <iostream>
#include <vector>
#include <stack>
#include <map>
#include <string>
#define DEBUG 1
enum class Operator {
AT = 0,
@dylanliuh2o
dylanliuh2o / 143最大异或对.cc
Created October 7, 2021 15:17
AcWing 143. 最大异或对
#include <iostream>
#include <vector>
#include <array>
using namespace std;
class TrieTree {
public:
TrieTree() : nodeSize(1) { }