Skip to content

Instantly share code, notes, and snippets.

@jethac
jethac / jpusers.php
Created February 21, 2016 04:33
[Moodle development kit] Script to create Japanese users
<?php
/**
* Create a set of users, with the students replaced with Japanese users.
*/
define('CLI_SCRIPT', true);
require(dirname(__FILE__).'/config.php');
require_once($CFG->libdir . '/filelib.php');
require_once($CFG->libdir . '/gdlib.php');
@jethac
jethac / phppassbybehavior.php
Created February 13, 2015 12:17
PHP pass-by behaviour
<?php
/**
* A script that illustrates how PHP is implicitly pass-by-value UNLESS
* we're talking about objects, in which case it's pass-by-reference.
*/
$myObj = new stdClass();
$myObj->foobar = "original value";
$myVar = "original value";
@jethac
jethac / olsongrabber.py
Created February 4, 2015 05:07
Olson timezone retriever
# olsongrabber.py - Olson timezone retriever
# Grabs the latest timezone information from the IANA and concatenates files together
# for use with Moodle, see:
# https://docs.moodle.org/dev/index.php?title=Timezone_information
import os
import shutil
from ftplib import FTP
import tarfile