Skip to content

Instantly share code, notes, and snippets.

View jdmichaud's full-sized avatar

jdmichaud

View GitHub Profile
@jdmichaud
jdmichaud / md.c
Last active June 21, 2025 06:06
Markdown parser
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <ctype.h>
#define MAX_LINE_LENGTH 4096 // Max line length for reading input (can be adjusted)
#define INITIAL_CHILDREN_CAPACITY 4
#define TAB_STOP_WIDTH 4
@jdmichaud
jdmichaud / sc-im-help.txt
Created June 20, 2025 19:12
sc-im help file
source: https://raw.githubusercontent.com/andmarti1424/sc-im/freeze/src/doc
see license: https://github.com/andmarti1424/sc-im/blob/main/LICENSE
This is the sc-im help file.
Use the arrow keys to move around, or 'j' to go down and 'k' to go up.
You can also use the <ENTER> key to go one line down and <DEL> to go up.
<SPACE> moves a page down, while <C-f> and <C-b> move half page down or up.
@jdmichaud
jdmichaud / index.html
Created May 14, 2025 07:17
Screen recorder
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Screen Recorder</title>
<script src="main.js"></script>
</head>
<body>
@jdmichaud
jdmichaud / README.md
Last active May 1, 2025 09:05
Zig utils

Zig utils

  • clap.zig: Command line argument
  • draw.zig: Provide a canvas context 'like' interface for drawing
  • io-adapter:
    • Keyboard/mouse input + graphic output
    • One adapter for SDL for now
  • misc.zig:
    • Load a file
  • Write an image (pgm or pam)
@jdmichaud
jdmichaud / Makefile
Last active May 4, 2025 12:01
Expression Parser
# Compiler
CC = gcc
SANITIZEFLAGS=-fsanitize=address -fsanitize=undefined
# Compiler Flags
# -Wall -Wextra: Enable comprehensive warnings (recommended)
# -g: Include debugging symbols (for GDB)
# -std=c99: Specify C standard (or -std=c11, -std=gnu99 etc.)
# -O2: Optimization level (optional, use for release builds)
@jdmichaud
jdmichaud / buildroot-riscv-kernel.md
Last active April 13, 2025 14:27
Builroot and RISCV
@jdmichaud
jdmichaud / Doxyfile
Created February 20, 2025 19:00
Doxygen
# Some sane config values
EXTRACT_ALL = YES
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
UML_LOOK = YES
UML_LIMIT_NUM_FIELDS = 50
TEMPLATE_RELATIONS = YES
@jdmichaud
jdmichaud / get-last-entry.sh
Last active February 17, 2025 13:54
artifactory
ARTIFACTORY_DOMAIN=$(grep '^registry=' ~/.npmrc | awk -F'=' '{print $2}' | awk -F/ '{print $3}')
ARTIFACTORY_TOKEN=$(grep '^//${ARTIFACTORY_DOMAIN}' ~/.npmrc | \
awk -F':' '{ print $2 }' | \
awk -F'_auth=' '{ print $2 }' | \
tr -d '"\r' | \
base64 -d | \
awk -F':' '{ print $2 }')
curl -H "Authorization: Bearer ${ARTIFACTORY_TOKEN}" \
"https://${ARTIFACTORY_DOMAIN}/artifactory/api/storage/${PATH_TO_RESOURCE}?list&deep=1&listFolders=1&mdTimestamps=1" \
@jdmichaud
jdmichaud / jenkins-hash.js
Created February 8, 2025 15:00
Jenkins hash
// Broken implementation
function hash(s) {
let hash = new Uint32Array(1);
hash[0] = 0;
for (let i = 0; i < s.length; ++i) {
const c = s[i].charCodeAt(0);
hash[0] += c;
hash[0] += (hash[0] << 10);
hash[0] ^= (hash[0] >> 6);
}