Skip to content

Instantly share code, notes, and snippets.

View ewilan-riviere's full-sized avatar
🦄

Ewilan Rivière ewilan-riviere

🦄
View GitHub Profile
@ewilan-riviere
ewilan-riviere / m4b-splitter.sh
Last active July 6, 2025 06:23
Split a M4B audiobook into chapters.
#!/bin/bash
# Description: Split a M4B audiobook into chapters.
# Requires: ffmpeg, ffprobe, jq, yq
# Author: Hasan Arous
# Improved by: Ewilan Rivière
# License: MIT
# https://unix.stackexchange.com/questions/499179/using-ffmpeg-to-split-an-audible-audio-book-into-chapters
# Usage: ./m4b-splitter.sh <input_file.m4b> [--no-convert | -n]
@ewilan-riviere
ewilan-riviere / parse-files.php
Last active August 12, 2024 08:41
Parse files with PHP
<?php
/**
* Tested with 1290 files: 21.43 sec
*/
private function parseFilesWithLaravelFile(string $path): array
{
$files = \Illuminate\Support\Facades\File::allFiles($path);
return array_map(fn (SplFileInfo $file) => $file->getPathname(), $files);
@ewilan-riviere
ewilan-riviere / domain.com.conf
Created August 10, 2024 07:09
NGINX reverse proxy example, v1.27.0
server {
listen 80;
listen [::]:80;
http2 on;
server_name domain.com; # change to your domain
# uncomment if you want to hide server for crawlers
# add_header X-Frame-Options "SAMEORIGIN";
# add_header X-Content-Type-Options "nosniff";
# add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
@ewilan-riviere
ewilan-riviere / database-docker.md
Last active July 22, 2024 15:38
Docker repositories to use databases with Docker.

Database Docker

MySQL

An open-source relational database management system.

MariaDB

@ewilan-riviere
ewilan-riviere / HandleInertiaRequests.php
Last active December 19, 2024 01:14
HandleInertiaRequests and other Inertia files. Example for Inertia with Ziggy (2024 version). Created by default when laravel/jetstream install Inertia with Vue 3 SSR.
<?php
// app/Http/Middleware/HandleInertiaRequests.php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Inertia\Middleware;
use Tighten\Ziggy\Ziggy;
@ewilan-riviere
ewilan-riviere / rust-setup.md
Last active April 28, 2024 08:36
How to install Rust
@ewilan-riviere
ewilan-riviere / php-array-object-typed.md
Created November 22, 2023 08:00
PHP array|object typed on VSCode.

PHP array|object typed on VSCode.

With vscode-intelephense extension (1.10.0 - 2023-11-05).

Array/Object shapes via annotations

/** @param array{foo:string, bar:int} $arrayShape */ or /** @return object{foo:string, bar:int} */

Improved type inference

@ewilan-riviere
ewilan-riviere / tsconfig.json
Created September 29, 2023 05:32
Laravel with Vite and TypeScript: tsconfig.json example
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
@ewilan-riviere
ewilan-riviere / ClientPost.php
Created July 25, 2023 11:28
PHP example to send HTTP Post with cURL, Stream or Guzzle.
<?php
namespace Kiwilan\Sentinel;
use Exception;
class ClientPost
{
protected function __construct(
readonly protected string $host,

Flutter

Flutter is an open-source UI software development kit created by Google. It is used to develop cross platform applications from a single codebase for any web browser, Fuchsia, Android, iOS, Linux, macOS, and Windows. First described in 2015, Flutter was released in May 2017.

See official Flutter website for more information.

macOS

Official guide: Install on macOS