Skip to content

Instantly share code, notes, and snippets.

View nickelpro's full-sized avatar
suzmarin

Vito Gamberini nickelpro

suzmarin
View GitHub Profile
@nickelpro
nickelpro / logger.cpp
Created December 21, 2021 04:48
Logger from my last project
#include "logger.hpp"
vea::Logger VEA_SIMPLE_LOGGER;
namespace vea {
const char* lvl_strings[] {"trace", "debug", "info", "warn", "fatal"};
Logger::Logger(const std::string& name) : name(name) {}
async function applyDivineFury(token, tactor, tokenId, type, origin) {
let damage = ` + (1d6 + ${(args[1] / 2) | 0})[${type}]`
let duration;
if (game.combat) {
duration = {
startRound: game.combat.round,
rounds: 0,
turns: 1
}
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
// None of these headers are available in xv6, in xv6 you only need to the
// "user.h" header
/**
* @brief Prints a region of memory to stdout as hex digits
module EdgeSync (
input clk,
input nReset,
input in,
output rise,
output fall,
output logic out
@nickelpro
nickelpro / BootstrapVcpkg.cmake
Last active August 4, 2024 13:34
Bootstrapping script that sets up vcpkg without having to clone the entire repo
if(NOT SKIP_VCPKG AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
include(FetchContent)
if(WIN32)
set(VCPKG vcpkg.exe)
elseif(LINUX)
if(EXISTS "/etc/alpine-release")
set(VCPKG vcpkg-musl)
else()
set(VCPKG vcpkg-glibc)
module UartTx (
input clk,
input nReset,
input logic [7:0] data,
input valid,
output out,
output busy,
#include <algorithm>
#include <array>
#include <concepts>
#include <cstdint>
#include <cstring>
#include <iterator>
#include <numeric>
#include <print>
#include <span>
#include <vector>