Skip to content

Instantly share code, notes, and snippets.

<?php
defined('MOODLE_INTERNAL') || die;
// Be sure to include the H5P renderer so it can be extended
//require_once($CFG->dirroot . '/mod/hvp/renderer.php');
/**
* Class theme_boost_mod_hvp_renderer
*
// Add the following code inside theme/snap/layout/default.php,
// just after "echo $OUTPUT->course_content_footer();"
global $DB;
$cm_info = $PAGE->cm;
if ($PAGE->pagelayout == 'incourse') {
$nextactivity = $DB->get_record_sql(
'SELECT cm.id, m.name
FROM {course_modules} AS cm
JOIN {modules} AS m ON m.id = cm.module
.dir-rtl .alert {
border-right: 3em solid;
}
.dir-rtl .close {
float: left;
}
@media (min-width: 992px) {
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
float: right;
<?php
// This client for ws is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
/// MOODLE ADMINISTRATION SETUP STEPS
// 2- Enable web service advance feature (Admin > Advanced features)
// 3- Enable REST protocol (Admin > Plugins > Web services > Manage protocols)
<?php
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
@nadavkav
nadavkav / get-security-patch-for-moodle.sh
Last active March 26, 2017 15:28
get security patch for moodle (bash script)
#!/bin/bash
#
# Example:
# ./get-security-patch-for-moodle.sh MOODLE_31_STABLE MDL-57596 --dry-run
#
SECURITY_FIX=$(curl -k "https://git.moodle.org/gw?p=moodle.git&a=search&h=$1&st=commit&s=$2")
SF_COMMIT=$(echo $SECURITY_FIX | grep -oP '<td class="link"><a href="(.*)">commit<\/a>' | grep -oP 'f=\"(.*)\"' | cut -d\" -f2)
SF_COMMIT_URL=$(echo "https://git.moodle.org".$SF_COMMIT | sed "s/a=commit/a=patch/")
curl -k $SF_COMMIT_URL > "security_fix_$2.patch"
patch -p1 $3 < "security_fix_$2.patch"
<!doctype html>
<html>
<head>
<!--link href="//vjs.zencdn.net/5.8/video-js.min.css" rel="stylesheet"-->
<link href="//vjs.zencdn.net/5.9/video-js.css" rel="stylesheet">
</head>
<body>
<video id=example-video width=600 height=300 class="video-js vjs-default-skin" controls></video>
# usr/local/nginx/conf/nginx.conf
#user nobody;
# do not use user root like I did!
user root;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
[Unit]
Description=nginx - high performance web server (compile from sources)
Documentation=http://nginx.org/en/docs/
After=network.target remote-fs.target nss-lookup.target
[Service]
#User=nginx
Type=forking
#PIDFile=/run/nginx.pid
PIDFile=/usr/local/nginx/logs/nginx.pid
var H5PEditor = H5PEditor || {};
var ns = H5PEditor;
// Register plugin with CK
//CKEDITOR.plugins.addExternal('base64image', '/var/www/html/moodle-org/master-dev/mod/hvp/editor/ckeditor/plugins/base64image/');
// Tell H5P about the plugin
ns.HtmlAddons = ns.HtmlAddons || {};
ns.HtmlAddons.img = ns.HtmlAddons.img || {};
ns.HtmlAddons.img.base64image = function (config, tags) {