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 / Now() in different formats.markdown
Last active January 6, 2016 12:06
Now() in different formats
@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>
{
"name": "brightcookie/lxhive",
"description": "An open-source LRS from Brightcookie",
"license": "GPL-3.0",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/sraka1/Slim"
}
],
<?php
/**
* @see https://github.com/Brightcookie/lxHive/issues/91
*/
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
@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 / learninglocker-verify-user.js
Created August 21, 2017 02:06
Leaninglocker Mongo tweaks
/**
* Verify a user (bypass email verification)
*/
db.getCollection('users').update({
"_id" : ObjectId("<users:record:_id>")
}, {
"$set": {
"verified": "yes"
}
});