Skip to content

Instantly share code, notes, and snippets.

View nonchip's full-sized avatar
‼️
this is mostly to read/fork/archive. same name on gitlab because fuck microsoft.

Kyra Zimmer nonchip

‼️
this is mostly to read/fork/archive. same name on gitlab because fuck microsoft.
View GitHub Profile
@geekley
geekley / NumberLimits.gd
Last active March 17, 2025 20:39
Numerical constants for limits of integers and IEEE 754 floats, defined as calculations of their exact values.
# Public domain, as per The Unlicense. NO WARRANTY. See https://unlicense.org
class_name NumberLimits
## Useful for dealing with numerical limits.
## Minimum positive 64-bit floating-point number > 0.
## [br]0x0000000000000001
const FLOAT64_MIN_SUBNORMAL: float = 2.0**-1074 # ≈ 4.9406564584124654e-324
## Maximum positive 64-bit floating-point subnormal number (min possible value in binary exponent).
## [br]0x000FFFFFFFFFFFFF
@samee
samee / CMakeLists.txt
Created November 29, 2019 21:17
Using ExternalProject with cmake
cmake_minimum_required(VERSION 3.10)
include(ExternalProject)
ExternalProject_Add(fmtlib
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
EXCLUDE_FROM_ALL TRUE
BUILD_COMMAND $(MAKE) fmt
STEP_TARGETS build)
set(fmtlib_BINARY_DIR "${CMAKE_BINARY_DIR}/fmtlib-prefix/src/fmtlib-build")
set(fmtlib_SOURCE_DIR "${CMAKE_BINARY_DIR}/fmtlib-prefix/src/fmtlib/include")
add_executable(fmttest fmttest.cpp)
@jlgerber
jlgerber / CMakeLists.txt
Last active May 21, 2024 20:28
cmake - handling executable and library with same name
# Lets say we want to add a library and an executable, both with the same name.
# In this example, it is resman
add_library(resman ${src_cpps} ${src_hpps} )
target_link_libraries(resman ${Boost_LIBRARIES} ${LIBYAML} ${LIBFMT})
#
# Add resman executable
#
# We call the executable resman-bin
add_executable(resman-bin main.cpp )
@MikuAuahDark
MikuAuahDark / stringstream.lua
Last active November 5, 2021 06:48
Lua 5.1 stringstream (pure)
local stringstream = {}
stringstream.__index = stringstream
function stringstream.create(str)
local out = setmetatable({}, stringstream)
out.buffer = str or ""
out.pos = 0
out.__index = stringstream
return out