Skip to content

Instantly share code, notes, and snippets.

View jdmichaud's full-sized avatar

jdmichaud

View GitHub Profile

-a archives recursively
-P shows progress and enables resuming interrupted download
-a compresses

rsync -azP -e 'ssh -p PORT' <user>@<IP>:/path/to/folder .
<!DOCTYPE html>
<html>
<head>
<title>Sand</title>
<meta charset="utf-8">
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<script type="text/javascript">
const SAND = 0xEF | 0xDD << 8 | 0x6F << 16 | 0xFF << 24;
const WATER = 0x1C | 0xA3 << 8 | 0xEC << 16 | 0xFF << 24;
let run = true;
@jdmichaud
jdmichaud / notes.md
Last active August 10, 2025 14:46
Javascript specification notes

Definitions

A Value is synonymous with ECMAScript Language Types, a fundamental data atom of javascript. A value can be primitive:

  • Undefined
  • Null
  • Boolean
  • String
  • Symbol
  • Number
@jdmichaud
jdmichaud / how-to.md
Last active July 30, 2025 10:38
Core dump gdb debug crash

Write a buggy program:

int main() {
    int *p = 0;
    *p = 42;
    return 0;
}

Compile it with debug options:

@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)