Skip to content

Instantly share code, notes, and snippets.

View borisschapira's full-sized avatar

Boris Schapira borisschapira

View GitHub Profile
@borisschapira
borisschapira / DaNuBe.md
Created May 30, 2026 09:44
Agent Mistral de coaching pour préparer l'oral du Diplôme National du Brevet

INSTRUCTIONS

RÔLE

Tu es DaNuBe, un outil de coaching pour préparer l'Oral du DNB (Diplôme National du Brevet). Tu aides un élève de 3e à définir son projet et préparer son oral en suivant une démarche très structurée, étape par étape, avec des livrables clairs à chaque palier :

@borisschapira
borisschapira / exportTimesheets_RL.js
Last active April 21, 2026 11:06
Go to /timesheets/. Use the arrow to navigate to a past week. Open the DevTools console, paste this script, and press "enter". The script collects billable and non-billable values, advances to the next week, and repeats until it reaches the current week. Expect an execution time of 5 seconds per week.
// ─────────────────────────────────────────────────────────────────
// Timesheet exporter – with billable/non-billable split support
// ─────────────────────────────────────────────────────────────────
// Checks whether the billable/non-billable split toggle is present and
// clickable, activates it, then waits for the DOM to re-render.
async function enableBillableSplit() {
const splitButton = document.querySelector(
'[data-cy="timesheets.buttons.split-billable-button"]:has([class*="secondary-bar__BillableNonSplitIcon"])'
);
// Script d'extraction des notes depuis EcoleDirecte
function extractGrades() {
const grades = [];
// Parcourir chaque ligne de matière
document.querySelectorAll('tbody tr').forEach(row => {
// Extraire le nom de la matière
const matiereElement = row.querySelector('.discipline .nommatiere .text-bold');
if (!matiereElement) return;
@borisschapira
borisschapira / script.js
Last active March 3, 2025 09:38 — forked from spf13/script.js
Download all your Kindle books before Feb 26, 2025
// 1. Log in to your Amazon account
// 2. Go to your Content Library > Books - https://www.amazon.fr/hz/mycd/digital-console/contentlist/booksAll/dateDsc/
// 3. Open your browser's Javascript console
// 4. For each page of books, paste this script into the console
(async function () {
// Close the notification if it appears
function closeNotification() {
const notifClose = document.querySelector("span#notification-close");
if (notifClose) {
@borisschapira
borisschapira / svgToPng.sh
Created November 21, 2024 18:06
Shell script to transform a folder of square-viewbox SVGs in 1024x1024 PNGs, changing the "currentColor" stroke color along the way
#!/bin/bash
# Prerequisites:
# - macOS (for the sed syntax with -i '')
# - inkscape is installed
# - usage: INKSCAPE_PATH=/Applications/Inkscape.app/Contents/MacOS/inkscape ~/svgToPng.sh ./SVG '#7c0033' 'BURGUNDY'
# Function to check if a string is a valid hexadecimal RGB color
is_valid_hex_rgb() {
@borisschapira
borisschapira / filter.svg
Created February 11, 2022 09:56
SVG filter for white drop shadow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@borisschapira
borisschapira / encoding-video.md
Created November 30, 2017 20:53 — forked from glen-cheney/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@borisschapira
borisschapira / ffmpegboris
Last active February 9, 2018 18:37
Config ffmpeg pour réencoder mes vidéos (gain de ~10x par rapport à la sortie de mon tél, ~5x par rapport à au Sony N5)
ffmpegboris() {
ffmpeg -i $1 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -movflags +faststart -vf scale=-2:720,format=yuv420p $1.optimized.mp4
}
ffmpegborisall () {
for i in *.(AVI|MP4|MOV|mov|mp4); do
if [[ ${i} != *"optimized"* ]];then
ffmpegboris $i;
fi
done
@borisschapira
borisschapira / functions.php
Created March 15, 2017 16:47
Displaying current branch in Wordpress Admin Area
/**
* Get the git branch
* @return mixed Either the branch name or the HEAD content or a boolean false
*/
function get_current_git_commit() {
if ( $hash = file_get_contents( get_home_path().'.git/HEAD' ) ) {
preg_match('/ref: refs\/heads\/(.*)/', $hash, $matches, PREG_OFFSET_CAPTURE);
if(count($matches)>=2) {
return $matches[1][0];
} else {
{
// Police à ligature
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
// Taille maximum des lignes et
// affichage des espaces
"editor.wrappingColumn": 80,
"editor.wordWrap": true,
"editor.renderWhitespace": "boundary",