Skip to content

Instantly share code, notes, and snippets.


TIm St.Clair frumbert

  • Repton, Australia
View GitHub Profile
frumbert / columns2.mustache
Last active Mar 15, 2022
Sample theme template renderer for filter_units (
View columns2.mustache
<div id="page" class="container-fluid">
{{{ output.full_header }}}
<div id="page-content" class="row">
<div id="region-main-box" class="col-12">
<div id="region-main-settings-menu" class="d-print-none">
<div> {{{ output.region_main_settings_menu }}} </div>
frumbert / index.html
Created May 4, 2020
xAPI Example - Send simple Statement to LRS
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Send xAPI statement</title>
<script type="text/javascript" src="xAPIWrapper-master/lib/cryptojs_v3.1.2.js"></script>
<script type="text/javascript" src="xAPIWrapper-master/lib/utf8-text-encoding.js"></script>
<script type="text/javascript" src="xAPIWrapper-master/src/activitytypes.js"></script>
<script type="text/javascript" src="xAPIWrapper-master/src/verbs.js"></script>
frumbert / index.php
Created Apr 13, 2020
Sort and Link to markdown files in nested sub-folders in PHP (e.g. build documentation)
View index.php
You have markdown files in nested folders which comtain
| |
| +--02.finalisation
| | |
| |
| | picture.png
frumbert / zipfolders.php
Created Sep 2, 2019
zip each folder in current directory recursively without the top-level folder, and name it after the directory
View zipfolders.php
$root = realpath(".");
$ar = array_diff(scandir($root), array('.','..'));
foreach ($ar as $fold) {
$rootPath = "{$root}/{$fold}";
if (is_dir($rootPath)) {
$zip = new ZipArchive();
$zip->open("{$rootPath}.zip", ZipArchive::CREATE | ZipArchive::OVERWRITE);
$files = new RecursiveIteratorIterator(
frumbert / block.php
Last active Sep 11, 2020
Block code for hacking scorm and completion data in Moodle (incomplete file, just the important function bits)
View block.php
// there's more to this file than this:
public function get_content()
global $CFG, $DB, $USER;
if (!is_siteadmin()) {
return null;
frumbert / sample-animation.svg
Created Feb 20, 2018
animated svg using smil
View sample-animation.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
frumbert / tab-title-marquee.html
Created Oct 27, 2017
Make a marquee on the browser title
View tab-title-marquee.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<script type="text/javascript">
message = "The quick brown 🦊 jumps over the lazy 🐶 ";
function step() {
message = message.substr(1) + message.substr(0,1);
document.title = message.substr(0,15);
frumbert / activity.php
Created Aug 12, 2017
In moodle, get a list of activities that are available and their index (order from the top down)
View activity.php
require('../../config.php'); // adjust as needed
$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
frumbert / function.js
Created Aug 9, 2017
blob to dataurl, because I keep forgetting how to do it!
View function.js
function blobToDataURL(blob) {
return new Promise((fulfill, reject) => {
let reader = new FileReader();
reader.onerror = reject;
reader.onload = (e) => fulfill(reader.result);
frumbert / Program.cs
Created Aug 9, 2017
c# to php encryption handy code snippet
View Program.cs
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.Security.Cryptography;
namespace csharpstuff
class MainClass