Skip to content

Instantly share code, notes, and snippets.

View DJmong's full-sized avatar

DJMong DJmong

View GitHub Profile
@echo off
setlocal
REM 현재 디렉토리에서 git commit code 기록
for /f "delims=" %%i in ('git rev-parse --short HEAD') do set current_commit=%%i
REM commit code를 target/ConsoleLaunch/git_version.txt에 기록
echo Current Directory Commit: %current_commit% > target/ConsoleLaunch/git_version.txt
echo Commit codes have been recorded in target/ConsoleLaunch/git_version.txt
@DJmong
DJmong / singleton.cpp
Created September 1, 2023 04:22
crtp_singleton
#include <iostream>
template <typename T>
class Singleton
{
protected:
Singleton() {}
public:
static T& getInstance()
@DJmong
DJmong / file_exist.cpp
Created August 7, 2023 01:40
file_exist check on windows11, C++17
#include <iostream>
#include <filesystem>
// *** OS : Windows
// *** Compiler : C++17
int directory_exist()
{
std::string dir = "C:\\test";
namespace fs = std::filesystem;
#include <iostream>
bool isPrime(const int &num)
{
if(num < 2) return false;
for(int i = 2; i*i <= num; ++i)
{
if(num % i == 0) return false;
}
return true;
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
std::vector<std::string> parseLine(std::string input, std::string del)
{
std::vector<std::string> result;
std::string parse = "";
@DJmong
DJmong / Timer.cpp
Last active March 7, 2022 03:42 — forked from mcleary/Timer.cpp
C++ Timer using std::chrono
#include "Timer.h"
void Timer::start()
{
m_StartTime = std::chrono::system_clock::now();
m_bRunning = true;
}
void Timer::stop()
{