Skip to content

Instantly share code, notes, and snippets.

View michaelfortunato's full-sized avatar
:shipit:
Thinking about groups

Michael Fortunato michaelfortunato

:shipit:
Thinking about groups
View GitHub Profile
@michaelfortunato
michaelfortunato / tiled-mat-mul.cu
Last active April 28, 2025 14:29
Matrix Multiplication Using Shared Memory
#include <cuda_runtime_api.h>
#include <stdio.h>
// Matrices are stored in row-major order:
// M(row, col) = *(M.elements + row * M.width + col)
struct Matrix {
int width;
int height;
float *elements;
};
@michaelfortunato
michaelfortunato / simple-mat-mul.cu
Created April 26, 2025 22:59
CUDA Matrix Multiplication Beginner
#include <cuda_runtime_api.h>
#include <stdio.h>
// Matrices are stored in row-major order:
// M(row, col) = *(M.elements + row * M.width + col)
struct Matrix {
int width;
int height;
float *elements;
};
#let typ(body) = html.elem(
"typ",
{
// distinguish parbreak from <p> tag
show parbreak: it => html.elem("typParbreak", "")
show linebreak: it => html.elem("typLinebreak", "")
show strong: it => html.elem("typStrong", it.body)
show emph: it => html.elem("typEmph", it.body)
show highlight: it => html.elem("typHighlight", it.body)
@michaelfortunato
michaelfortunato / job_control_zsh_bash.md
Created March 14, 2025 14:37 — forked from CMCDragonkai/job_control_zsh_bash.md
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@michaelfortunato
michaelfortunato / flake.nix
Last active January 9, 2025 18:14
Basic Latex Flake Template
{
description = "A simple LaTeX template for writing documents with latexmk";
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };
outputs = { self, nixpkgs }:
let
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSupportedSystems = nixpkgs.lib.genAttrs supportedSystems;
in {
@michaelfortunato
michaelfortunato / tex.Makefile
Last active January 8, 2025 00:04
Makefile for building TeX pdfs
# This Makefile is to run commands. While justfiles are better purposed
# It is unlikely Make will go away and it works well enough for my needs.
TEX_FILE ?= main.tex
AUX_DIR := aux
.PHONY: pdf open clean
refresh: pdf reload
@michaelfortunato
michaelfortunato / ANSI.md
Created October 6, 2023 17:58 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@michaelfortunato
michaelfortunato / tsconfig.json
Last active November 12, 2021 04:49
Typescript configuration
{
"extends": "@tsconfig/recommended/tsconfig.json",
"include": ["./src"],
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
@michaelfortunato
michaelfortunato / eslintrc.yaml
Created November 12, 2021 04:42
Eslint Configuration (with prettier + typescript support)
env:
commonjs: true
es2021: true
node: true
extends:
- airbnb-base
- "prettier"
parser: "@typescript-eslint/parser"
parserOptions:
ecmaVersion: 5
@michaelfortunato
michaelfortunato / .prettierignore
Last active April 6, 2022 04:08
Configuration for prettier
node_modules
**/.next/**
**/_next/**
**/dist/**
packages/next/bundles/webpack/packages/*.runtime.js
packages/next/compiled/**
packages/react-refresh-utils/**/*.js
packages/react-refresh-utils/**/*.d.ts
packages/react-dev-overlay/lib/**
**/__tmp__/**