This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
mb_internal_encoding('UTF-8'); | |
$message = [ | |
'ar' => 'عام سعيد', | |
'bn-IN' => 'শুভ নববর্ষ!', | |
'ca' => 'Bon any nou', | |
'cs' => 'Štastný nový rok!', | |
'cy' => 'Blwyddyn newydd dda!', | |
'de' => 'Frohes neues Jahr!', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$connect = ftp_connect('ftp.mozilla.org'); | |
$login = ftp_login($connect, 'anonymous', ''); | |
$versions = [ | |
'1.0', '1.5', '2.0', '3.0', '3.5', '3.6', '4.0', '5.0', '6.0', '7.0', '8.0', | |
'9.0','10.0', '11.0', '12.0', '13.0', '14.0.1', '15.0', '16.0', '17.0', '18.0', | |
'19.0','20.0', '21.0', '22.0', '23.0', '24.0', '25.0', '26.0', '27.0', '28.0', | |
'29.0','30.0', '31.0', '32.0', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias git_show_remote=git_show_remote | |
function git_show_remote() | |
{ | |
for k in `git branch -r | perl -pe 's/^..(.*?)( ->.*)?$/\1/'`; do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- | head -n 1`\\t$k; done | sort -r | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/classes/Langchecker/LangManager.php b/classes/Langchecker/LangManager.php | |
index ce450ad..bdebe36 100644 | |
--- a/classes/Langchecker/LangManager.php | |
+++ b/classes/Langchecker/LangManager.php | |
@@ -385,4 +385,16 @@ class LangManager | |
return $result; | |
} | |
+ | |
+ public static function importTransvisionEntity($repository, $english, $entity) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getSVNCommitTimestamp($file) | |
{ | |
exec("svn info --xml ${file} 2>/dev/null", $output, $return_code); | |
if ($return_code) { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Script should not be called from the Web | |
if (php_sapi_name() != 'cli') { | |
die('Nope'); | |
} | |
$settings = parse_ini_file(__DIR__ . '/../config/config.ini'); | |
if(! isset($settings['l10nwebservice'])) { | |
error_log('L10n Web service variable in config.ini is not defined'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function cleanEntity($entity) | |
{ | |
$component = explode('/', $entity); | |
array_pop($component); // suppress entity | |
$component = array_filter( | |
$component, | |
function($val) { return $val != 'chrome'; } | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isUTF8($filename) | |
{ | |
$info = finfo_open(FILEINFO_MIME_ENCODING); | |
$type = finfo_buffer($info, file_get_contents($filename)); | |
finfo_close($info); | |
return ($type == 'utf-8' || $type == 'us-ascii') ? true : false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getBugsFromCSV($csv, $full = false) | |
{ | |
$shortBugs = $fullBugs = $temp = []; | |
if (($handle = fopen($csv, 'r')) !== false) { | |
while (($data = fgetcsv($handle, 300, ',')) !== false) { | |
if ($data[0] == 'bug_id') { |