Skip to content

Instantly share code, notes, and snippets.

View pascalchevrel's full-sized avatar

Pascal Chevrel pascalchevrel

View GitHub Profile
@pascalchevrel
pascalchevrel / v.py
Last active March 4, 2026 13:40
Python version of my PHP version script, converted by Gemini
#!/usr/bin/env python3
import json
import re
import urllib.request
from concurrent.futures import ThreadPoolExecutor
# ANSI Color Codes
BOLD_GREEN = "\033[1;32m"
CYAN = "\033[96m"
RED = "\033[1;31m"
#!/usr/bin/env php
<?php
/*
PHP script to fetch Firefox Desktop and Android shipped versions from API
and output readable results to your terminal.
chmod +x this file and set it as a bash alias:
alias v="path/to/firefox_versions.php"
The output will look like this:
@pascalchevrel
pascalchevrel / gist:6d46dc625526ed098555686f0cade5ba
Last active March 2, 2026 11:08
ChatPGT prompt to search for interesting release notes
Analyse all the bugs that landed during the 148 nightly cycle.
The goal is to identify new features and important changes and create release notes for end-users.
I am providing you a json file that contains data for all the bugs that were included during the 148 development cycle.
This JSON is an export of all the bugs from bugzilla.mozilla.org via its public API.
The bugzilla documentation for the API is here https://bmo.readthedocs.io/en/latest/api/index.html
In our release notes we have several sections:
NEW
FIXED
CHANGED
@pascalchevrel
pascalchevrel / index.php
Last active October 8, 2025 14:07
Soft code freeze email
<?php
date_default_timezone_set('UTC');
$api_endpoint = 'https://whattrainisitnow.com/api';
function convertJson(string $url): array {
return json_decode(file_get_contents($url), true);
}
$version = 'nightly';
@pascalchevrel
pascalchevrel / index.php
Last active October 8, 2025 14:07
Major releases and dot releases per owner since version 122
<?php declare(strict_types=1);
function convertJson(string $url): array {
return json_decode(file_get_contents($url), true);
}
$api_root = 'https://whattrainisitnow.com/api/';
$owners = convertJson($api_root . 'release/owners/');
$releases = convertJson($api_root . 'firefox/releases/');
$current_release = (int) explode('.', array_key_last($releases))[0];
@pascalchevrel
pascalchevrel / extract_fxios_tickets.sh
Created August 6, 2025 08:34
extract_fxios_tickets
# Function to extract the list of Jira tickets touched by commits in firefox-ios repo
# The first parameter is the commit hash of the version bump
# You can passs a folder as an optional parameter to only extract focus-ios tickets for example
extract_fxios_tickets() {
if [ -z "$1" ]; then
echo "Usage: extract_fxios_tickets <starting_commit> [path]"
return 1
fi
local start_commit="$1"
@pascalchevrel
pascalchevrel / backport.py
Created September 18, 2023 16:54
List backports on branch X that were not cherrypicked in branch X+1
#!/usr/bin/env python3
# usage: backports.py 117
import os
import sys
version = sys.argv[1]
# Create a list of commits not merged directly in the version +1 branch
<?php
$results = [];
foreach (range(1, 100) as $x) {
$rule = fn($y) => is_int($x / $y);
$results[] = match(true) {
$rule(15) => 'fizzbuzz',
$rule(3) => 'fizz',
$rule(5) => 'buzz',
@pascalchevrel
pascalchevrel / karma.php
Last active March 1, 2023 16:11
Uplift Karma value
<?php
declare(strict_types=1);
function getJson(string $url): array
{
$data = file_get_contents($url);
return json_decode($data, true, 512, JSON_THROW_ON_ERROR);
}
$bugs = [
@pascalchevrel
pascalchevrel / gist:463fc7b1f0382f187820
Last active December 22, 2021 23:39
Example script to use with github webhooks to update a site when pushing on master
<?php
/* Webhook to update a repo for each push on GitHub. */
date_default_timezone_set('Europe/Paris');
$header_match = 'HTTP_X_HUB_SIGNATURE';
$secret_key = 'my_secret_key_in_github_webhook';
$branch = 'master';
function logHookResult($message , $success = false) {