Skip to content

Instantly share code, notes, and snippets.

View francois-rozet's full-sized avatar
🤔

François Rozet francois-rozet

🤔
View GitHub Profile
@francois-rozet
francois-rozet / fontawesome.typ
Created November 6, 2023 09:30
FontAwesome for Typst
#let fa(key) = text(font: "FontAwesome", ligatures: false, [#key])
// Regular icons
#let fa-ad = symbol("\u{f641}")
#let fa-address-book = symbol("\u{f2b9}")
#let fa-address-card = symbol("\u{f2bb}")
#let fa-adjust = symbol("\u{f042}")
#let fa-air-freshener = symbol("\u{f5d0}")
#let fa-align = symbol(
@francois-rozet
francois-rozet / tiny_imagenet.py
Created August 25, 2023 14:54
Tiny ImageNet dataset
import numpy as np
import re
import torch
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
from PIL import Image
from tqdm import tqdm
from typing import Callable
@francois-rozet
francois-rozet / flow_matching.py
Last active April 21, 2024 14:26
Flow Matching in 100 LOC
#!/usr/bin/env python
import math
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from sklearn.datasets import make_moons
from torch import Tensor
from tqdm import tqdm
@francois-rozet
francois-rozet / Makefile
Last active May 31, 2023 06:54
Step-by-step Makefile tutorial
# Macros
ALL = program1 program2 program3
SRCDIR = src/
BINDIR = bin/
EXT = cpp
CXX = g++
CXXFLAGS = -std=c++14 -O3 -Wall -Wextra
@francois-rozet
francois-rozet / Dir2Submodule.md
Created January 6, 2019 01:40
Tutorial on how to transform a repository directory into a submodule

Directory to submodule

Sometimes you realize a part of your current project (like a library for example) should have it's own repository. Sure, you could simply copy and paste the files into a newly created repository, but you would lose all the previous commit network. Not loosing this network while isolating a part of your porject is the goal of this tutorial.

Let ~root/project be the absolute path of your project and path/to/subproject the path to your subproject directory (the directory you want to isolate) relatively to the project path, so that ~root/project/path/to/subproject is the absolute path of the subproject.

Since we never modify to the actual project until the last step, it's all safe. However, always keep a copy of your project somewhere.

  1. Isolate the submodule in its own directory.