Skip to content

Instantly share code, notes, and snippets.

View aduh95's full-sized avatar

Antoine du Hamel aduh95

View GitHub Profile
@aduh95
aduh95 / record.js
Created March 2, 2024 15:38
Record canvas to make a video
function recordCanvas(canvas, time) {
const frameRate = 60;
const mimeType = "video/webm";
const chunks = [];
function saveChunks(evt) {
// store our final video's chunks
if (evt.data.size > 0) {
chunks.push(evt.data);
}
@aduh95
aduh95 / fstab_for_dualboot.md
Last active January 9, 2021 22:58
Auto-mount a NTFS partition on a GNU/Linux system (Windows dualboot)

Dual-boot GNU/Linux↔Windows file sharing

You want to use the same files on different environment? Here is how to setup your Linux system.

It is strongly recommended to have a separate partition for every OS you want to have and another partition on which you want to store your data. If you are using UNIX-like OSes only, you can have a /home partition that every OS will share and you don't need this tutorial. However, if you want to use a Windows OS as well, here is what you need to do.

[Go to memo](./Generate random colors that look great on white background.md).

#!/usr/bin/env node
import { promises as fs, createReadStream } from "fs";
import { createBrotliCompress } from "zlib";
import { resolve, join } from "path";
const DIR = resolve(process.argv[2]);
fs.readdir(DIR)
.then(files =>
@aduh95
aduh95 / COURS
Last active February 9, 2020 16:23
This gist contains the code I have written during my classes; this code is quite old, it doesn't reflect my current coding style.
# DO NOT USE ANY OF THIS
This gist is here for my own reference. You can browse the files if you feel like it,
but keep in mind most of this code is plain garbage :)
#!/bin/bash
tar -cf ~/Documents/home.tar ~/.vscode ~/.ssh ~/.config/fish ~/.config/Code ~/.bash_aliases
@aduh95
aduh95 / .gitconfig
Created December 6, 2018 15:44
File I use for my git config
[alias]
lcm = !"git log -1 --pretty=%s"
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
const { spawn } = require("child_process");
const { promises: fs } = require("fs");
const path = require("path");
const GUETZLI_EXEC = "C:\\ProgramData\\chocolatey\\bin\\guetzli.EXE";
const MAGICK_EXEC = "C:\\ProgramData\\chocolatey\\bin\\magick.EXE";
// const sizes = [190, 290, 415, 830, 1125];
// const sizes = [612];
const sizes = [317, 830];
@aduh95
aduh95 / SassMeister-input.scss
Last active October 23, 2018 15:01
Generated by SassMeister.com.
// ----
// libsass (v3.5.4)
// ----
// custom responsive
// custom variables
// colors
// main colors
$custom-color-primary: #3dcd58;

Keybase proof

I hereby claim:

  • I am aduh95 on github.
  • I am aduh95 (https://keybase.io/aduh95) on keybase.
  • I have a public key ASDQ0EuwikxsBDgg7y1dFeZptMBPWQlFs7VayGo6uFWSCQo

To claim this, I am signing this object: