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 | |
/** | |
* Calculate the Root Mean Squared Error (RMSE) metric between 2 images. | |
* | |
* Quick and dirty pure PHP implementation | |
* of the Root Mean Squared Error metric (RMSE) | |
* used to compare two images and calculate their difference: | |
* - Requires the php-gd extension to be available. | |
* - Using the four (RGB+A) channels. |
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
# Clean any directory only containing phpunit.xml | |
# sure it was created for another branch and does | |
# not exist in current one. | |
candidates=$(find . -name phpunit.xml -not -path "./vendor/*" | xargs dirname | sort -r) | |
for candidate in ${candidates}; do | |
numfiles=$(ls -1 ${candidate} | wc -l) | |
if [[ ${numfiles} -eq 1 ]]; then | |
echo "Deleting empty ${candidate}" | |
rm -fr ${candidate} | |
# if that leads to an empty parent, delete it too |
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/admin/cli/fix_orphaned_calendar_events.php b/admin/cli/fix_orphaned_calendar_events.php | |
index 8a203b74391..20f83d5170a 100644 | |
--- a/admin/cli/fix_orphaned_calendar_events.php | |
+++ b/admin/cli/fix_orphaned_calendar_events.php | |
@@ -113,7 +113,7 @@ if (moodle_needs_upgrading()) { | |
// Report current site status. | |
cli_heading('Checking the site status'); | |
-upgrade_calendar_site_status(); | |
+$needsfix = upgrade_calendar_site_status(); |
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
import jenkins.model.* | |
import hudson.remoting.Launcher | |
import hudson.slaves.SlaveComputer | |
def expectedVersion = Launcher.VERSION | |
for (computer in Jenkins.instance.getComputers()) { | |
if (! (computer instanceof SlaveComputer)) continue | |
if (!computer.getChannel()) continue | |
def version = computer.getSlaveVersion() |
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 admin/cli/fix_orphaned_calendar_events.php --fix | |
== Checking the site status == | |
This site has executed the problematic upgrade step 2020061504.08 present in 3.9.5. | |
Fix upgrade steps were NOT found. | |
This site NEEDS to run the calendar events fix! | |
You can use this CLI tool or upgrade to a version of Moodle that includes | |
the fix and will be executed as part of the normal upgrade procedure. |
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 admin/cli/fix_orphaned_calendar_events.php --fix | |
== Checking the site status == | |
This site has executed the problematic upgrade step 2020061504.08 present in 3.9.5. | |
Fix upgrade steps were NOT found. | |
This site NEEDS to run the calendar events fix! | |
You can use this CLI tool or upgrade to a version of Moodle that includes | |
the fix and will be executed as part of the normal upgrade procedure. |
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
#!/usr/bin/env bash | |
# This script must be put in dirroot, so it's able to find lang files in expected locations. | |
basepath=${1:-.} # Defaults to current directory, relative dir to look for uses. | |
pe=0 # print_error() calls | |
petra=0 # translated print_error() calls | |
pelit=0 # literal passed in print_error() calls | |
me=0 # moodle_exception() calls |
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
#!/bin/bash | |
# Note this is useful when comparing 2 development branches that other than versions and upgrade lines shoudl be 99% | |
# the same. Of course before they really begin to diverge, then the utility is not useful any more. | |
# Setup the desired branches | |
branch1=MOODLE_311_STABLE | |
branch2=master | |
# Prepare branches |
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
#!/opt/local/bin/bash | |
export WORKSPACE=/tmp/ws | |
export CODEDIR=/Users/stronk7/git_moodle/ci-tests | |
export BUILD_ID=cirunner | |
export PHP_VERSION=${PHP_VERSION:-7.3} | |
export DBTYPE=${DBTYPE:-pgsql} |
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
" Override the default @Spell on strings via after syntax. | |
" The lines are 100% the original ones, just changing @Spell by @NoSpell | |
" Maybe this can be done simpler, but it's easier to just keep a copy | |
" of the original php.vim code and perform the replacement to @NoSpell. | |
if (exists("php_parent_error_open") && php_parent_error_open) | |
syn region phpStringDouble matchgroup=phpStringDelimiter start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@NoSpell,@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex,phpStrEsc contained keepend | |
syn region phpBacktick matchgroup=phpStringDelimiter start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@NoSpell,@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex,phpStrEsc contained keepend | |
syn region phpStringSingle matchgroup=phpStringDelimiter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@NoSpell,@phpAddStrings,phpStrEsc contained keepend | |
else | |
syn region phpStringDouble matchgroup=phpStringDelimiter start=+"+ skip=+\\\\ |
NewerOlder