Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

String Distribution for Firefox Aurora, based on data from Transvision

View gist:9623606
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
<?php
function cleanEntity($entity)
{
$component = explode('/', $entity);
array_pop($component); // suppress entity
$component = array_filter(
$component,
function($val) { return $val != 'chrome'; }
);
return implode('/', $component);
}
function excludeProducts($entity)
{
$component = explode('/', $entity);
if (in_array($component[0], ['chat', 'calendar', 'suite',
'mail', 'editor', 'extensions'] ))
{
return false;
}
return true;
}
include __DIR__ . '/TMX/aurora/en-US/cache_en-US.php';
$tmx = array_keys($tmx);
$tmx = array_map('cleanEntity', $tmx);
$tmx = array_filter($tmx, 'excludeProducts');
$results = [];
$devtools = 0;
foreach ($tmx as $val) {
$component = explode('/', $val);
$main_component = $component[0];
if (in_array('devtools', $component)) {
$devtools++;
}
if (! isset($results[$main_component])) {
$results[$main_component] = 1;
} else {
$results[$main_component] += 1;
}
}
foreach ($results as $component => $number) {
print $component . ' : ' . $number . '<br>';
}
print "(of which devtools: $devtools )<br>";
print 'Total: ' . count($tmx) . '<br>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.