Skip to content

Instantly share code, notes, and snippets.

View brrd's full-sized avatar

Thomas Brouard brrd

View GitHub Profile
@brrd
brrd / lodel_backoffice_hotkey.user.js
Last active July 1, 2022 12:36
Lodel Backoffice Hotkey
// ==UserScript==
// @name Lodel Backoffice
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Accès au backoffice Lodel avec CTRL + SHIFT + L
// @author brrd
// @match https://*.edinum.org/*
// @match https://*.openedition.org/*
// @icon https://www.edinum.org/img/edinum-logo.png
// @grant GM_log
@brrd
brrd / rm-recursive.js
Created January 22, 2022 10:12
Node 14 recursive rm
import fs from 'fs/promises';
async function main() {
await fs.rm(myDir, { recursive: true, force: true });
}
@brrd
brrd / arrays_dynamiques_lodelscript.html
Last active January 21, 2022 15:01
Arrays dynamiques LodelScript
TEST <br>
<LET ARRAY="test"></LET>
<LET ARRAY="test.foo">bar</LET>
<LET VAR="lorem">baz</LET>
<LET ARRAY="test.#LOREM">ispum</LET>
res: [#TEST.FOO] - [#TEST.#LOREM] - [#TEST.BAZ]<br>
[#TEST|var_dump]
// TEST
// res: bar - ispum - ispum
@brrd
brrd / .cspell.json
Last active April 13, 2022 12:18
Defaults
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"language": "fr",
"ignorePaths": ["node_modules"]
}
@brrd
brrd / trace.js
Created April 14, 2021 13:18
Get stack trace
const trace = new Error().stack.split("\n")[1].replace(/^\s*at\s*/, "");
@brrd
brrd / fill-localstorage.js
Created December 17, 2020 17:10
Fill localStorage with data
localStorage.clear();
var i = 0;
var str = 'x'.repeat(50);
while(true) {
localStorage.setItem(i, str);
i++;
}
@brrd
brrd / github-tab-size.user.js
Last active May 13, 2020 09:34
github-tab-size.user.js
// ==UserScript==
// @name github-tab-size
// @namespace http://brrd.fr
// @version 0.2
// @description Fix tab size in Github
// @author brrd
// @match *.github.com/*
// @grant GM_addStyle
// ==/UserScript==
@brrd
brrd / append.bat
Created April 24, 2020 09:10
ImageMagick append scripts
REM Script à copier dans le dossier où se trouvent les images.
@echo off
setlocal enabledelayedexpansion enableextensions
mkdir output
set list=
for %%f in (*.png) do @set list=!list! %%f
set list=%list:~1%
echo Traitement des images : %list%
@brrd
brrd / index.php
Created April 6, 2020 22:39
Paged.js + Hyphenopoly (quick test)
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
@media print {
h1, h2, h3, h4, h5, h6 {
break-after: avoid;
@brrd
brrd / inset-box-shadow-on-round-image.css
Last active February 20, 2022 14:05
Subtle inset box-shadow on round images
.img-container {
width: 100%;
max-width: 100px;
position: relative;
}
.img-container::after {
content: '';
position: absolute;
top: 0;