Skip to content

Instantly share code, notes, and snippets.

@RoboSparrow
RoboSparrow / getStatements.html
Last active August 29, 2015 14:07
Asynchronous xAPI call example
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="https://raw.githubusercontent.com/adlnet/xAPIWrapper/master/xapiwrapper.min.js"></script>
</head>
<body>
<script>
/**
* Example of wrapping ADL.XAPIWrapper.getStatements into a flexible asynchronous pattern.
* It allows both the use of ES-6 promises or traditional callbacks.
@RoboSparrow
RoboSparrow / xAPI-xhr-statement.html
Last active September 16, 2016 08:18
Simple xAPI XMLHttpRequest example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>XHR lxHive</title>
</head>
<body>
<p>Sending a statement to <strong id="Endpoint"></strong></p>
@RoboSparrow
RoboSparrow / Now() in different formats.markdown
Last active January 6, 2016 12:06
Now() in different formats
<?php
/**
* @see https://github.com/Brightcookie/lxHive/issues/91
*/
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
{
"name": "brightcookie/lxhive",
"description": "An open-source LRS from Brightcookie",
"license": "GPL-3.0",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/sraka1/Slim"
}
],
@RoboSparrow
RoboSparrow / rollup.config.js
Last active May 15, 2017 09:00
Quick and Dirty Rollup copy plugin
//..imports for rollup.config
////
// plugin for copy
////
import fs from 'fs';
import path from 'path';
const copyPlugin = function (options) {
return {
@RoboSparrow
RoboSparrow / switch-php.sh
Last active July 17, 2017 05:44
helper script for switching PHP versions
#!/bin/bash
###
# Script for switching PHP versions
# Ubuntu 16.x dual php install.
# Instructions on how to set this up: http://robosparrow.github.io/2016/12/10/php-5-on-ubuntu16.html
###
GREEN="$(tput setaf 2)"
RED="$(tput setaf 1)"
@RoboSparrow
RoboSparrow / 01-distinct.statements.js
Last active October 27, 2018 04:34
lxHive Mongo Admin
// get a list of all verb ids
db.getCollection('statements').distinct('statement.verb.id');
// get a list of all object activity ids
db.getCollection('statements').distinct( "statement.object.id");
// get a list of object definition extension sub property values
db.getCollection('statements').distinct( "statement.object.definition.extensions.https://lxhive[dot].com/recipes/extensions/object.subType");
// get a list of object id's containing "lesson"
db.getCollection('statements').find({"statement.object.id": /lesson/});
// get a list of all verb display["en-US"] values
db.getCollection('statements').distinct('statement.verb.display.en-US');