Skip to content

Instantly share code, notes, and snippets.

View rubpy's full-sized avatar
💭
💥 Phosphorylating

pr3 🪤 rubpy

💭
💥 Phosphorylating
View GitHub Profile
@rubpy
rubpy / Makefile
Created January 16, 2023 18:18
A quick Makefile! 🧩
# ===== Directory structure =====
# build/
# foo/
# another.c.o
# main
# main.c.o
# other.c.o
#
# lib/
#
@rubpy
rubpy / encrypt_with_bear.c
Last active July 29, 2022 20:53
encrypt_with_bear - a handy wrapper for the low-level BearSSL RSA encryption API
#include <bearssl.h>
#include <derdec.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
/* (RSA-2048)
-----BEGIN PUBLIC KEY-----
MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBez9MX9NzGasT/wlMKgLPL
@rubpy
rubpy / derdec.h
Last active July 30, 2022 19:03
derdec.h - a silly single-header library for extracting modulus N & exponent E arbitrary-precision integers from ASN.1 DER-encoded RSA public keys
#ifndef DERDEC_H
#define DERDEC_H
// clang-format off
/****************************************************************************
*
* MIT License
*
* Copyright (c) 2022 by pr3 (https://discord.com/users/552136433742381066 👀)
@rubpy
rubpy / seg_display.ino
Created June 20, 2022 23:01
A (better-coded) example of a 0-to-9 counter running on an Arduino & displaying the digits on a 7-segment LED display
#include <stdint.h>
/**
* A (better-coded) example of a 0-to-9 counter running on
* an Arduino & displaying the digits on a 7-segment LED display.
*
* Based on: https://create.arduino.cc/projecthub/akhtar/simple-0-9-counter-dcba41
*
* Try it in a simulator: https://wokwi.com/projects/335025004843369044
*/