Skip to content

Instantly share code, notes, and snippets.

View ArnaudLigny's full-sized avatar

Arnaud Ligny ArnaudLigny

View GitHub Profile
@ArnaudLigny
ArnaudLigny / Git Doc.md
Created April 26, 2026 12:45 — forked from Tlaloc-Es/Git Doc.md
Git basic workflow

Git workflow

image

The workflow outlined below is a basic one that would be used when we want to do product development without maintaining older versions.

For example, there may be projects where a version 1.0.0 of the product is generated, and then a version 2.0.0 of the product is developed. In such cases, you may want to support version 1.0.0 while continuing to develop version 2.0.0 by adding commits for fixes to both versions but only new features to the latest version.

This workflow is primarily not intended for such cases but rather for situations where the latest published version is the only one maintained, as in the case of a service or a library.

@ArnaudLigny
ArnaudLigny / website.yml
Created January 4, 2024 13:42
GitHub Action workflow: build & deploy a website with Cecil
name: Build & deploy website
on:
push:
branches: [master, main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
<?php
// build an inverted index
// https://en.m.wikipedia.org/wiki/Inverted_index
function buildInvertedIndex(array $filenames): array
{
$invertedIndex = [];
foreach($filenames as $filename) {
$data = file_get_contents($filename);
@ArnaudLigny
ArnaudLigny / tailwind-darkmode-toggle.html
Created February 10, 2022 09:24 — forked from sjones6/tailwind-darkmode-toggle.html
A darkmode toggle using tailwindcss
<div class="w-14 h-8">
<input type="checkbox" id="dark-mode-toggle" class="hidden" onchange="document.documentElement.classList.toggle('dark')" />
<label for="dark-mode-toggle" class="w-full h-full bg-gray-800 dark:bg-white rounded-full p-1 flex justify-between cursor-pointer">
<span class="inline dark:hidden">🌞</span>
<span class="w-6 h-6 rounded-full bg-white dark:bg-gray-800 block float-right dark:float-left"></span>
<span class="hidden dark:inline">🌛</span>
</label>
</div>
@ArnaudLigny
ArnaudLigny / composer.json
Last active November 6, 2021 02:37 — forked from 2bard/translation_notes
Using Symfony Translation component with Twig outside of Symfony.
{
"require": {
"symfony/translation": "^5.0",
"symfony/twig-bridge": "^5.0",
"symfony/yaml" : "^5.0",
"twig/twig": "^3.0"
}
}
@ArnaudLigny
ArnaudLigny / build.sh
Last active March 3, 2021 22:06
Cecil build script
# What this script do?
# 1. install Cecil if `cecil.phar` is not found (force a specific version with `CECIL_VERSION`)
# 2. install Composer if `composer.phar` is not found
# 3. install theme(s) if `composer.json` is found
# 4. run `php cecil.phar build -v`
if [ ! -f "./cecil.phar" ]; then
echo "Downloading Cecil"
if [ -z $CECIL_VERSION ]; then
curl -sSOL https://cecil.app/cecil.phar
@ArnaudLigny
ArnaudLigny / Git.php
Created November 13, 2020 22:10
Cecil/Util
<?php
/**
* This file is part of the Cecil/Cecil package.
*
* Copyright (c) Arnaud Ligny <arnaud@ligny.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@ArnaudLigny
ArnaudLigny / DynamicComparisons.php
Last active November 13, 2020 22:10
Cecil/Util
<?php
/**
* This file is part of the Cecil/Cecil package.
*
* Copyright (c) Arnaud Ligny <arnaud@ligny.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@ArnaudLigny
ArnaudLigny / twitch.js
Last active November 12, 2020 20:35
How To Block Twitch Ads
# https://ttv-ublock.vercel.app/twitch-videoad.js
const origFetch = window.fetch;
window.fetch = (url, init, ...args) => {
if (typeof url === "string") {
if (url.includes("/access_token")) {
// url = url.replace("player_type=site", "player_type=site");
} else if (
url.includes("/gql") &&
init &&
typeof init.body === "string" &&
@ArnaudLigny
ArnaudLigny / gh-pages-deploy.sh
Last active October 6, 2021 20:53
A bash script to deploy a static site on GitHub Pages.
#!/bin/bash -e
USER_NAME="Build Bot"
USER_EMAIL="build@domain.tld"
REPOSITORY="username/repository"
TARGET_BRANCH="gh-pages"
SITE_DIR="_site"
echo "Started deploy to $REPOSITORY/$TARGET_BRANCH"