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 | |
require('../../config.php'); // adjust as needed | |
require_once($CFG->dirroot.'/course/format/lib.php'); | |
require_once($CFG->libdir.'/modinfolib.php'); | |
$courseid = 26; // the numerical id of the course we are looking in | |
$index = 1; | |
$course = get_course($courseId); // in course/format/lib.php | |
$modinfo = get_fast_modinfo($course); // in lib/modinfolib.php |
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
function blobToDataURL(blob) { | |
return new Promise((fulfill, reject) => { | |
let reader = new FileReader(); | |
reader.onerror = reject; | |
reader.onload = (e) => fulfill(reader.result); | |
reader.readAsDataURL(blob); | |
}) | |
} |
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
using System; | |
using System.IO; | |
using System.Text; | |
using System.Collections.Generic; | |
using System.Security.Cryptography; | |
namespace csharpstuff | |
{ | |
class MainClass | |
{ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>game</title> | |
</head> | |
<body> | |
<script> | |
hiscore = score = 1000; | |
player = { |
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 | |
// you would probably use this within your theme or block - anywhere inside a course context. | |
// a moodle function for returning the url adjacent to the current page in a course | |
// tested in Moodle 3 and higher. | |
// sourced from within https://moodle.org/plugins/block_navbuttons then refactored a bit to my needs | |
// lets say you are on http://mymoodle.com/mod/page/view.php?id=302 | |
// and you want to know what the activity immediately after this one is. You'd ask |
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 | |
Class Sayable { | |
// the different components of words | |
private $phonetics = array( | |
"Affricate" => array("ch","dg","j"), | |
"Alveolar" => array("d","l","n","r","s","t","z"), | |
"Bilabial" => array("b","m","p"), | |
"BilabialStop" => array("b","p"), |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<title>title</title> | |
</head> | |
<body> | |
<p>HoverThumb: mouse over a link to see a full image preview. the href of the hyperlink points to the image.</p> | |
<p>Adjust as required.</p> |
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 pages = [{ | |
title: "alice", | |
depth: 0 | |
},{ | |
title: "bob", | |
depth: 1 | |
},{ | |
title: "charles", | |
depth: 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
var Mime = (function() { | |
var db = [{"mime":"application/andrew-inset","extn":["ez"]},{"mime":"application/applixware","extn":["aw"]},{"mime":"application/atom+xml","extn":["atom"]},{"mime":"application/atomcat+xml","extn":["atomcat"]},{"mime":"application/atomsvc+xml","extn":["atomsvc"]},{"mime":"application/bdoc","extn":["bdoc"]},{"mime":"application/ccxml+xml","extn":["ccxml"]},{"mime":"application/cdmi-capability","extn":["cdmia"]},{"mime":"application/cdmi-container","extn":["cdmic"]},{"mime":"application/cdmi-domain","extn":["cdmid"]},{"mime":"application/cdmi-object","extn":["cdmio"]},{"mime":"application/cdmi-queue","extn":["cdmiq"]},{"mime":"application/cu-seeme","extn":["cu"]},{"mime":"application/dash+xml","extn":["mdp"]},{"mime":"application/davmount+xml","extn":["davmount"]},{"mime":"application/docbook+xml","extn":["dbk"]},{"mime":"application/dssc+der","extn":["dssc"]},{"mime":"application/dssc+xml","extn":["xdssc"]},{"mime":"application/ecmascript","extn":["ecma"]},{"mime":"application/emma |
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
// e.g. $("#my-child-div").fillRemainingHeight(); | |
(function( $ ){ | |
$.fn.fillRemainingHeight = function( ) { | |
return this.each(function () { | |
var $this = $(this), | |
_h = $this.parent().height(), | |
_used = 0; | |
$this.siblings().each(function(){ _used+= $(this).outerHeight(); }); | |
$this.css("height", _h - _used); | |
}); |
NewerOlder