Skip to content

Instantly share code, notes, and snippets.

View MatteoGauthier's full-sized avatar
🌴
Working on squale.agency 🍹

Mattèo Gauthier MatteoGauthier

🌴
Working on squale.agency 🍹
View GitHub Profile
@MatteoGauthier
MatteoGauthier / ffmpeg-video-snippets.md
Last active February 29, 2024 10:45
FFMPEG command snippets for video related processing

Get video framerates

Detailed video file information

ffprobe -loglevel 0 -print_format json -show_format -show_streams YOURFILE

List video files informations in the current directory

@MatteoGauthier
MatteoGauthier / touch-screen-device-webpage-setup.md
Last active February 2, 2024 14:29
Chromium Based web browser setup for touchable kiosk experience

Setup guide for a touch screen with a webpage

Prevent physical device hijacking

  • Disable access to serial ports
  • Disable physical buttons
  • Disable unnecesary wireless communication

Chromium startup with flags

@MatteoGauthier
MatteoGauthier / auth.ts
Last active January 3, 2024 01:49
Kinde OAuth as a next-auth provider
export const authOptions = {
// ...
providers: [
{
id: "kinde",
name: "Kinde",
type: "oauth",
wellKnown: `https://TENANT_ID.kinde.com/.well-known/openid-configuration`,
idToken: true,
authorization: {
float space = 10.;
vec2 p = (FC.xy * 2.0 - r) / r.y * 3.;
vec2 x, d;
for (float i = 1.0 - fract((t)); i < 25.0; i += 0.5) {
x = p + (cos(i * vec2(0.1, 0.5) + t) + vec2(0, 4.0 - i)) / i * (space / 2.0);
d = vec2(4, sin(i) * 0.4 * x * 2e-1 ) / i * 4.;
o += (cos(max(i, 3.) + vec4(0, 2, 4, 0)) + 1.0) / (length(x - d * clamp(dot(x, d) / dot(d, d), -11.0, 11.0)) + i / 1e8) / max(i * i, 5.0) * .12;
}
import time
import random
from pynput.keyboard import Controller
keyboard = Controller() # Create the controller
def type_string_with_delay(string):
for character in string: # Loop over each character in the string
keyboard.type(character) # Type the character
delay = random.uniform(0, 2) # Generate a random number between 0 and 10
@MatteoGauthier
MatteoGauthier / package.json
Last active January 24, 2023 00:21
Modern package.json & tsconfig.json file [ESNEXT]
{
"version": "1.0.0",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"type": "module",
}
@MatteoGauthier
MatteoGauthier / useElementSize.tsx
Created November 2, 2022 13:18
React hook to listen to element size changes
import { useEffect, useMemo, useRef, useState } from 'react';
type ObserverRect = Omit<DOMRectReadOnly, 'toJSON'>;
const defaultState: ObserverRect = {
x: 0,
y: 0,
width: 0,
height: 0,
top: 0,
@MatteoGauthier
MatteoGauthier / README.md
Created June 2, 2022 07:42
Snippet - Stripe open in gmail button

Open in GMAIL button

Capture d’écran 2022-06-02 à 09 40 33

<a href={`https://mail.google.com/mail/u/{email}/#search/from:notifications@stripe.com`}>Open in Gmail</a>
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://vercel.com/</loc>
<lastmod>2019-09-11T15:11:59+00:00</lastmod>
@MatteoGauthier
MatteoGauthier / README.md
Last active November 2, 2022 13:22
Notion Dark Legacy - Custom style - Stylus - userstyles

Notion Dark Legacy

www notion so_matteogauthier_2bc7d76e5cc7469dba806a8e3d4a1cb3_v=b571030537874051abd43c9f36366f5b

/* ==UserStyle==
@name         Notion Dark Legacy
@version      20220223.10.26
@namespace    userstyles.world/user/matteogauthier