Skip to content

Instantly share code, notes, and snippets.

# 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;
<!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>
@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"
<?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="">
<?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)
.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;
// 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
<?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
*
@nadavkav
nadavkav / h5p-editor-interactive-video.json
Last active January 8, 2018 18:39
h5p-editor-interactive-video (default English translation)
{
libraryStrings: {
selectVideo: "You must select a video before adding interactions.",
noVideoSource: "No Video Source",
notVideoField: "\":path\" is not a video.",
notImageField: "\":path\" is not a image.",
insertElement: "Click and drag to place :type",
popupTitle: "Edit :type",
done: "Done",
loading: "Loading...",
<?php
// Moosh/Command/Moodle23/Config/ConfigGet.php
/**
* moosh - Moodle Shell
*
* @copyright 2012 onwards Tomasz Muras
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace Moosh\Command\Moodle23\Config;