Skip to content

Instantly share code, notes, and snippets.

View sleepdefic1t's full-sized avatar

₴Ⱡ33₱ sleepdefic1t

View GitHub Profile
@sleepdefic1t
sleepdefic1t / printf64.h
Created August 30, 2019 12:49
PRINTF uint64_t
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
uint64_t i;
printf("%"PRIu64"\n", i);
@sleepdefic1t
sleepdefic1t / unpack.h
Last active September 18, 2019 01:48
Unpack Little and Big Endian Unsigned Integers uint16_t, uint32_t, uint64_t
/********************************************************************************
*
* Copyright (c) Simon Downey <[email protected]> <https://github.com/sleepdefic1t>
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
@sleepdefic1t
sleepdefic1t / ledger_unpack.h
Created September 10, 2019 17:52
Ledger SDK Unpack Big/Little-Endian 8-bytes Uint64's
/*******************************************************************************
* Ark Wallet
* (c) 2017 Ledger
* (c) ARK Ecosystem
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
/*******************************************************************************
* Ark Wallet
* (c) 2017 Ledger
* (c) ARK Ecosystem
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
###
include("${CMAKE_SOURCE_DIR}/cmake/CodeCoverage.cmake")
APPEND_COVERAGE_COMPILER_FLAGS()
setup_target_for_coverage_lcov(
NAME ${PROJECT_NAME}_coverage
EXECUTABLE PROJECT_TEST_NAME
@sleepdefic1t
sleepdefic1t / README.md
Created October 4, 2019 09:03
CMake: Print All Environment Variables

CMake: Print All Environment Variables

get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
    message(STATUS "\n${_variableName}=${${_variableName}}\n")
endforeach()
#
#
# Downloads GTest and provides a helper macro to add tests. Add make check, as well, which
# gives output on failed tests without having to set an environment variable.
#
#
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
if(CMAKE_VERSION VERSION_LESS 3.11)
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")

Reset a Forked Repo's Master to Upstream

# ensures current branch is master
git checkout master

# pulls all new commits made to upstream/master
git pull upstream master

# this will delete all your local changes to master
@sleepdefic1t
sleepdefic1t / base58.cpp
Created November 18, 2019 22:21
C++ Base58 - Basic Impl
std::vector<uint8_t> decodeBase58(const uint8_t *in, const size_t length) {
unsigned char const BASE58TABLE[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf,
@sleepdefic1t
sleepdefic1t / src-CMakeFiles.txt
Created November 29, 2019 23:18
Radians C++ Scooter Registration Implementation
cmake_minimum_required(VERSION 3.2)
project(ark_cpp_crypto C CXX)
# ------------------------------------------------------------------------------
# External Libraries
# ------------------------------------------------------------------------------
include(${CMAKE_SOURCE_DIR}/cmake/External.cmake)