Skip to content

Instantly share code, notes, and snippets.

View Sharp0802's full-sized avatar

Yeong-won Seo Sharp0802

View GitHub Profile

Clone libpcap repository and Create build directory.

$ cd path/to/libpcap/source
$ mkdir build
$ cd build

Then, Write Android.cmake, CMake toolchain file for Android.

@Sharp0802
Sharp0802 / Program.cs
Created March 20, 2024 12:01
Interop std::string to C++ from C# with P/Invoke
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
unsafe
{
var ns = new NativeString("Hello from C++!");
WriteLine(&ns);
}
@Sharp0802
Sharp0802 / bypass.md
Created December 13, 2023 01:02
학생설문도조사 bypass script for Benedu
document.querySelectorAll("div.timeline-item > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > label:nth-child(1)").forEach(e => e.click());
document.querySelector("#btn-submit").click();
setTimeout(function(){document.querySelector(".btn-primary").click()}, 200);

To copy paste to your browser, type below:

  • firefox:
@Sharp0802
Sharp0802 / CMakeLists.txt
Created July 28, 2023 19:43
Sample CMakeLists.txt for C++23
cmake_minimum_required(VERSION 3.20)
project(project LANGUAGES CXX)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/bin/)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/bin/)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/bin/)
@Sharp0802
Sharp0802 / log.inl
Created July 28, 2023 19:39
Logging sample with C++23
#ifndef LOG_INL
#define LOG_INL
/* === USAGE =================================
*
* LOG(FAIL) << "use like std::cout";
* LOG(NOTE) << "can change log-level";
* LOG("level") << "can use custom log-level";
*
* ===========================================