Skip to content

Instantly share code, notes, and snippets.

View pascalchevrel's full-sized avatar

Pascal Chevrel pascalchevrel

View GitHub Profile
@pascalchevrel
pascalchevrel / nightlyUpdate.py
Created September 14, 2016 13:19
Script to check if an update to Nightly is available for a platform. Usage: nightlyUpdate.py en-GB win64
#!/usr/bin/python
import sys
import urllib2
import json
from datetime import datetime, timedelta
import sys
@pascalchevrel
pascalchevrel / check_locales_product_details.php
Last active August 5, 2016 11:14
PHP script checking if the data in product-details for aurora and nighmty matches what we actually build from mercurial
<?php
function getJson($file) {
return json_decode(
file_get_contents('https://product-details.mozilla.org/1.0/' . $file),
true
);
}
function getProductDetailsLocales($version) {
#! /usr/bin/env bash
# Pretty printing utility function
function echogreen() {
NORMAL=$(tput sgr0)
GREEN=$(tput setaf 2; tput bold)
echo -e "$GREEN$*$NORMAL"
}
# Path to the temporary profile
<?php
/**
* Return the current URL with the json GET variable appended
* This is used on views which also exist in our public API
* https://github.com/mozfr/transvision/wiki/JSON-API
*
* @param boolean $swap_locales Defaults to False. If set to True, swap the
* values of locale and source_locale parameters.
* @return string URL with 'json' appended as part of the query string
*/
@pascalchevrel
pascalchevrel / patchy.txt
Created January 20, 2016 10:52
A bash function to put in your .bash_aliases to send the diff of your repo (hg, git svn…) to a remote 'patches' folder that you make web accessible for sharing
function patchy()
{
tmp='/tmp/diff_being_sent_to_your_server'
$1 diff > $tmp
scp $tmp john@doe.com:/home/john/patches/$2.diff
rm $tmp
}
@pascalchevrel
pascalchevrel / gist:27442f9bb5119caf2b76
Last active October 12, 2015 12:31
Cherry pick commit from local another local repository (used for bedrock-l10n production)
# Bedrock prod commit cherry-pick
commit() {
cd /home/pascalc/repos/github/bedrock-l10n
git --git-dir=../www.mozilla.org/.git format-patch -k -1 --stdout $1 | git apply
}
# example use: commit 27c3da077cb8ba3b4b048307bfd514700571578d
@pascalchevrel
pascalchevrel / class.dc.piwik.php
Last active August 29, 2015 14:24
Modif du code du plugin Piwik pour Dotclear
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2008 Olivier Meunier and contributors
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
@pascalchevrel
pascalchevrel / functests.php
Last active August 29, 2015 14:22
Functional regression tests for the Stores l10n API between 1.0 and 2.0 of the app
<?php
namespace Verif;
class Verif
{
protected $host;
public $target;
protected $content = false;
protected $status = 0;
@pascalchevrel
pascalchevrel / gist:052f0dadba4ffabe86c2
Last active August 29, 2015 14:21
Redirections billets blog.mozfr.org vers firefoxos.mozfr.org
RewriteEngine on
RewriteBase /
# Migration des billets du blog principal vers le blog FirefoxOS
RewriteRule ^(post/2015/05/Ce-qui-a-etonne-AmarOk-en-rejoignant-le-groupe-comm-pour-Firefox-OS-et-Mozilla)$ https://firefoxos.mozfr.org/$1 [L,R=301]
RewriteRule ^(post/2015/04/Mamie-Fox-fait-des-cookies-3D)$ https://firefoxos.mozfr.org/$1 [L,R=301]
RewriteRule ^(post/2015/05/Philippe-a-aussi-participe-au-futur-de-Firefox-OS)$ https://firefoxos.mozfr.org/$1 [L,R=301]
RewriteRule ^(post/2015/05/Firefox-OS-dans-la-presse-en-avril)$ https://firefoxos.mozfr.org/$1 [L,R=301]
RewriteRule ^(post/2015/04/Naissance-Firefox-pour-Android-29-mars-2011)$ https://firefoxos.mozfr.org/$1 [L,R=301]
<?php
$history['sub'] = 'beta';
$hosts = [
0 => [
'foo' => 0,
'bar' => 1
],
1 => [