Skip to content

Instantly share code, notes, and snippets.

@nbonnec
nbonnec / convert_teams_wiki.py
Last active May 24, 2023 17:56 — forked from kai2nenobu/convert_teams_wiki.py
Convert a mht file for Microsoft Teams Wiki into markdown format
import logging
import sys
from bs4 import Tag, NavigableString, BeautifulSoup
logger = logging.getLogger(__name__)
class Context:
def __init__(self):
@nbonnec
nbonnec / command.gdb
Last active January 9, 2025 13:24
Useful commands in GDB
# Print 256 words in hexadecimal format
x/256wx (int*)&chip.sectors[1]
# Display code at address
list *address
@nbonnec
nbonnec / gdb.py
Last active January 8, 2021 13:24
Pretty print in Python for GDB
from gdb.printing import PrettyPrinter, register_pretty_printer
import gdb
import uuid
# https://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html#Python-API
# https://interrupt.memfault.com/blog/automate-debugging-with-gdb-python-api
class MultipleDefaultObserverPrinter(object):
""" Print the observed default. """
#include <array>
#include <iostream>
template <typename T>
auto oldFoldSumR(T t) {
return t;
}
template <typename T1, typename ...Ts>
@nbonnec
nbonnec / example-standard.cpp
Last active October 21, 2020 20:05
Standard Library example
#include <algorithm>
#include <functional>
#include <iostream>
#include <iterator>
#include <numeric>
#include <vector>
int main() {
const std::array a1 = {1, 2, 3, 4, 5};
const std::array a2 = {1, 2, 4, 4, 5};
https://apps.crashlytics.com/register/MLGdBGyLFCvRUADsLVxthpt8/rsvp?utm_medium=email&utm_source=invite_tester
@nbonnec
nbonnec / cause_hardfault.c
Last active May 15, 2018 12:48
Fault handlers for STM32
void (*cause_hardfault)(void);
cause_hardfault();
@nbonnec
nbonnec / Connectivity.java
Created March 9, 2017 15:02 — forked from emil2k/Connectivity.java
Android utility class for checking device's network connectivity and speed.
package com.emil.android.util;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Check device's network connectivity and speed
* @author emil http://stackoverflow.com/users/220710/emil