Skip to content

Instantly share code, notes, and snippets.

View adrienjoly's full-sized avatar
☺️
In the flow

Adrien Joly adrienjoly

☺️
In the flow
View GitHub Profile
@adrienjoly
adrienjoly / index-volume.sh
Created July 15, 2025 17:39
a bash/terminal script to index the contents of a volume into a TXT file. tested on macOS.
# usage ./index-volume.sh "Photos 2017-08"
# ... will index the list of files from "/Volumes/Photos 2017-08"
# ... to ~/Desktop/volumes/Photos 2017-08.txt
set -e # stop the script if any command fails with a non-zero exit code
mkdir -p ~/Desktop/volumes
ls -R "/Volumes/$1" > ~/Desktop/volumes/"$1.txt"
cat ~/Desktop/volumes/"$1.txt"
drutil eject external
@adrienjoly
adrienjoly / backup-disk.sh
Created July 15, 2025 17:37
a bash/terminal script to copy all files of a volume (with their attributes) to a local directory. tested on macOS.
# Usage:\
# $ cd /Volumes
# $ ls
# $ ./backup-disk.sh "Archives musique"
set -e # stop the script if any command fails with a non-zero exit code
echo Backup "$1" to "~/Downloads/BluRay/$1/" ...
cp -Rpnf "./$1" "$HOME/Downloads/BluRay/"
@adrienjoly
adrienjoly / howto-propose-prepare-and-give-a-talk.md
Created May 13, 2025 07:55
Tips and resources on how to propose, prepare and give conference/meetup talks, and feeling good while doing it.

Public Speaking Tips

If you are interested in how to propose, prepare and give conference/meetup talks, and feeling good while doing it, here are some resources to help:

@adrienjoly
adrienjoly / decode_jwt_token.sh
Last active April 24, 2025 14:50
Script to decode a JWT token locally, using Node.js
node -p 'process.env.TOKEN.split(".").map(part => Buffer.from(part, "base64").toString())'
@adrienjoly
adrienjoly / react-and-jsx-without-build-chain.html
Created March 29, 2024 14:22
Pure/static HTML page that renders a React app (with JSX) and imports components without build chain nor transpilation.
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/umd/react.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/umd/react-dom.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@babel/[email protected]/babel.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@mui/[email protected]/umd/material-ui.production.min.js"></script>
</head>

Jouer à des jeux PCVR sur Meta Quest avec Shadow et Virtual Desktop

Mon équipement et configuration:

  • Meta Quest de première génération
  • Connexion à Internet: abonnement Sosh Fibre, via Livebox 4 avec version de firmware G06.R01.C06_02, UPnP et IPV6 actifs
  • En guise de PC, un abonnement Shadow Boost à 30€/mois
  • Et une license Virtual Desktop, achetée via Steam

1. Prérequis sur le PC (Shadow)

@adrienjoly
adrienjoly / globals.d.ts
Created January 15, 2024 14:49
Typing a `globalThis` variable on Node.js, using TypeScript.
declare global {
// Note: It is crucial to note that [...] variables must only be declared using var
// cf https://copyprogramming.com/howto/using-globalthis-in-typescript
var myGlobalVariable: string;
}
// => `globalThis.myGlobalVariable` is properly typed as `string`
@adrienjoly
adrienjoly / rename-photos-by-date.sh
Created December 23, 2023 10:43
Rename photos by date
for f in photos/*.*; do
mv "$f" "photos/$(stat -f '%Sm' -t '%Y-%m-%d_%H%M%S' "$f").${f##*.}"
done
@adrienjoly
adrienjoly / typescript-type-guard-function-using-jsdoc.js
Created November 23, 2023 13:46
Type guard, so that void/undefined can be excluded from an array's type, after filtering them out, using JSDoc type annotations.
/**
* Type guard, so that void/undefined can be excluded from an array's type, after filtering them out.
* @template T
* @param {T | void} val
* @returns {val is T}
*/
const isDefined = (val) => val && typeof val === 'object'
/** @type {number[]} */
const numbers = [-1, 1, 2]
@adrienjoly
adrienjoly / download-using-puppeteer-and-interceptors.js
Created June 19, 2023 08:30
Login and download a HTTPS response using Puppeteer and request interceptors.
// Note: this script does not work anymore on hackmd.io, because of recaptcha protection.
// But the same logic can be reused on other websites, e.g. for backup automation.
const puppeteer = require("puppeteer");
const { DEBUG } = process.env; // for verbose request logs, pass DEBUG='*'
/** @returns a `untilRequest()` method that resolves when `targetURL` is requested by `page`. */
const interceptRequests = async (page) => {
await page.setRequestInterception(true);