Skip to content

Instantly share code, notes, and snippets.

View fabienjuif's full-sized avatar
🦝
meow!

Fabien JUIF fabienjuif

🦝
meow!
  • Cantina
  • Saumur, France
  • 10:14 (UTC +02:00)
View GitHub Profile
@fabienjuif
fabienjuif / settings.json
Created May 25, 2026 12:22
Claude Code | Status line
Example render
---
Migrate CircleCI deploy job to GitHub Actions | ~/w/c/e/r/backend | [main] | 5h:2% 7d:4%
@fabienjuif
fabienjuif / Dockerfile
Created December 24, 2025 08:34
Vite / Runtime variables
ARG WEB_TAG=yourrepo/web:latest
# front assets
# we have to do this "from" as a workaround because --from does not support build args
FROM ${WEB_TAG} AS web_build
# generate-env image
FROM fabienjuif/generate-env:latest AS generate_env
FROM nginx:1.29.2
@fabienjuif
fabienjuif / batcher.go
Last active October 5, 2025 08:34
Golang pool batchers
package batcher
import (
"context"
"errors"
"log/slog"
"sync"
"sync/atomic"
"time"
)
@fabienjuif
fabienjuif / config.kdl
Created June 17, 2025 08:45
Niri config
// This config is in the KDL format: https://kdl.dev
// "/-" comments out the following node.
// Check the wiki for a full description of the configuration:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
// Input device configuration.
// Find the full list of options on the wiki:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
input {
keyboard {
@fabienjuif
fabienjuif / sharescreen.sh
Created May 16, 2025 11:07
sharescreen.sh / wayland | sway
#!/bin/bash
# for this to works you need to recompile xdg-desktop-portal-wlr with the following patch:
# - https://github.com/emersion/xdg-desktop-portal-wlr/pull/156/files
# - packaged for void with https://github.com/emersion/xdg-desktop-portal-wlr/pull/156/files
CONFIG="${HOME}/.config/xdg-desktop-portal-wlr/config"
function usage() {
echo "Usage: $0 - Configure xdg-desktop-portal-wlr to share the whole screen"
@fabienjuif
fabienjuif / switch_refresh.sh
Created May 8, 2025 08:56
Sway / Switch refresh rate (MAX_REFRESH_RATE) without vrr with half this value + vrr
#!/bin/bash
function usage() {
echo "Usage: $0 <mode>"
echo "Modes:"
echo -e "\t- switch: Switch between max refresh rate with VRR disabled to half the refresh rate and VRR enabled"
echo -e "\t- read: Read the current refresh rate"
}
# check min args
@fabienjuif
fabienjuif / README.md
Last active May 17, 2022 07:14
jest / typescript / mock class prototype

What

You can use this helper to mock AND types your class methods.

Example

class A {
  foo(a: number, b: number): number { return a + b }
}
@fabienjuif
fabienjuif / gist:f678311481d3d2dbce555943c50fd0fb
Last active March 2, 2022 09:25
windows forward port to wsl2
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.26.17.154
netsh interface portproxy reset all
@fabienjuif
fabienjuif / build.js
Created November 16, 2019 14:34
Overriding react with preact and create-react-app (react-scripts)
/*
* You have to install preact (DO NOT INSTALL preact-compat)
* You DO NOT NEED to eject, just replace your package.json scripts.build with 'node ./scripts/build.js'
*/
process.env.NODE_ENV = 'production';
const configFactory = require('react-scripts/config/webpack.config');
module.constructor._cache[
require.resolve('react-scripts/config/webpack.config')
Uncaught (in promise) TypeError: Cannot read property 'numberOfItems' of undefined
at particles.js:1
at Array.forEach (<anonymous>)
at particles.js:1
[WARNING] Crisp found shims of native JavaScript methods. This can alter the chatbox behavior and break things. Make sure not to override listed functions to ensure your chatbox works as expected. You may be looking for other JavaScript libraries in use on this page.
You can disable this warning by adding: $crisp.push(["safe", true]) to your page JavaScript.