Skip to content

Instantly share code, notes, and snippets.

View BDeliers's full-sized avatar

Balthazar BDeliers

View GitHub Profile
@BDeliers
BDeliers / Dockerfile
Last active October 8, 2024 19:04
nRF Connect SDK devcontainer for Visual Studio Code
# Derive from Nordic's image, SDK version 2.5
FROM nordicplayground/nrfconnect-sdk:v2.5-branch
# Update the distro
RUN apt-get -y update
# Install git and GDB
RUN apt-get -y install git gdb-multiarch
# Create the workspace folder
RUN mkdir /workdir/workspace
@BDeliers
BDeliers / EnumParse.py
Created July 23, 2023 07:37
Parse an enum from a C file to a C array associating enum index to its corresponding string
#!/usr/bin/python3
"""
Parse an enum from a C file to a C array associating enum index to its corresponding string
BDeliers, July 2023
"""
import re
if __name__ == "__main__":

Emulate Apline for RPi with QEMU

Instructions for Ubuntu 20.04LTS and QEMU installed from APT Based on Alpine Wiki

Install syslinux sudo apt-get install syslinux -y

Make an empty disk image

@BDeliers
BDeliers / PhotoOrganizer.py
Created February 2, 2023 17:33
Automatically sort your pictures in a date-dependent directories tree !
#!/bin/python3
"""
Script to make directories tree from image's EXIF shot date
BDeliers - January 2023
"""
__docformat__ = 'reStructuredText'
import argparse
import datetime
import os
@BDeliers
BDeliers / VCC-PIC16F153xx.c
Last active June 15, 2021 11:07
Self-measure supply voltage from PIC16F153xx
// DIA addresses
#define TSLR2 0x8113
#define FVRA1X 0x8118
#define FVRA2X 0x8119
// Read from Device Information Area
uint16_t DIARead(uint16_t addr) {
// Access DIA
NVMCON1 = 0b01000000;
// Set address
@BDeliers
BDeliers / PriorityQueue.py
Created October 2, 2018 08:34
Simple priority queue implementation for Python3
class PriorityQueue:
"""
Priority queue implementation
by BDeliers, June 2018
"""
def __init__(self):
self.__queue = []
def __repr__(self):