This file contains hidden or 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
$default = match (true) { | |
isset($this->sebdata[$name]) => $this->sebdata[$name], | |
isset($this->quiz->{$name}) => $this->quiz->{$name}, | |
default => $defaults[$name], | |
}; | |
$mform->setDefault($name, $default); |
This file contains hidden or 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
protected function get_override(): ?\stdClass { | |
... | |
$override = $DB->get_record(...); | |
if (!$override) { | |
... | |
} | |
return $override ?: null; | |
} |
This file contains hidden or 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
return [ | |
[ | |
// Create a user with empty email address. | |
[ | |
'email' => '', | |
'username' => 'testuser', | |
], | |
"Sending messages to testuser (%d)\n". | |
" Failed to send post %d\n". | |
"Sent 0 messages with 1 failures\n". |
This file contains hidden or 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
====================== | |
Proton: 1591366924 proton-5.0-8 | |
SteamGameId: 1213210 | |
Command: ['/home/steam/.steam/steam/steamapps/common/CnCRemastered/ClientLauncherG.exe'] | |
Options: {'forcelgadd'} | |
====================== | |
ERROR: ld.so: object '/home/steam/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. | |
ERROR: ld.so: object '/home/steam/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. | |
ERROR: ld.so: object '/home/steam/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. | |
ERROR: ld.so: object '/home/steam/.steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. |
This file contains hidden or 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
$packer = new zip_packer(); | |
if ($file) { | |
$itemid = $file->get_itemid(); | |
$filepath = $file->get_filepath(); | |
$filelist = $file->list_files($packer); | |
$numberoffiles = 0; | |
foreach ($filelist as $f) { | |
if (!$f->is_directory) { | |
$numberoffiles++; | |
} |
This file contains hidden or 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
var views = this.NavController._views; | |
views.forEach(function(view) { | |
if (view.id === "CoreCourseSectionPage") { | |
view._cntDir.resize(); | |
} | |
}); |
This file contains hidden or 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 | |
namespace format_oustudyplan\output; | |
defined('MOODLE_INTERNAL') || die(); | |
class mobile { | |
public static function mobile_course_view($args) { | |
global $OUTPUT; |
This file contains hidden or 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
# Ping the specified host (argument $1). If it's not there, wait 30 seconds and try again. | |
# If its not there for 2 minutes, do a clean shutdown. | |
# The host should be connected to the nextwork and plugged into a socket that's not backed up by the UPS. | |
# This should be run on a host that is backed up by the UPS, on a cron job. | |
tail -c 10000 /var/log/canary.log > /var/log/canary.log | |
REBOOT=true | |
for e in a b c d | |
do | |
sleep 30 | |
if ping -c1 $1 |
This file contains hidden or 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
# Usage: upyours.rb episode1.mp3 episode2.mp3 jingle.mp3 outputfile.mp3 | |
# License: https://opensource.org/licenses/MIT | |
duration = `ffprobe -v 0 -show_entries format=duration -of compact=p=0:nk=1 #{ARGV[0]}`.to_f # Get the duration of the first file | |
fingerprint = `fpcalc #{ARGV[2]} -length 10 -raw`.lines[2].split('=')[1].split(',') # Get the fingetprint of the third file | |
$lt1000 = false # Set a flag | |
$discrepencies = Hash.new() # Store discrepencies for each clip | |
((duration.to_i*10-(90*10))..(duration.to_i*10)).each do | offset | # Scan through the last 90 seconds of the episode, in 1/10s intervals | |
pos = (offset.to_f / 10) # Caluclate the starting position of the clip | |
`ffmpeg -y -t 10 -ss #{pos} -i #{ARGV[0]} /tmp/testclip.mp3 > /dev/null 2>&1` # Get a 10 second clip from the starting position | |
testprint = `fpcalc /tmp/testclip.mp3 -length 10 -raw`.lines[2].split('=')[1].split(',') # Get the fingerprint of the clip |
This file contains hidden or 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 | |
# Kill any existing streams | |
killall makemkvcon | |
# Display a notification while MakeMKV scans the disc | |
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Loading","message":"Scanning disc, please wait...", "displaytime": 30000},"id":1}' http://localhost:8080/jsonrpc | |
makemkvcon stream dev:/dev/sr0 & | |
# Wait until port 51000 has a service running on it (this is the port MakeMKV uses for the UPnP share). | |
while [ -z "$(netstat -a | grep 51000)" ] | |
do | |
sleep 1 |
NewerOlder