Skip to content

Instantly share code, notes, and snippets.

Robert (Jamie) Munro rjmunro

Block or report user

Report or block rjmunro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rjmunro / walk.js
Created Mar 23, 2018
Script to walk browser-compat-data and find common subtrees
View walk.js
#!/usr/bin/env node
// To use:
// npm install object-hash
var Hash = require('object-hash');
var Data = require('.');
rjmunro / index.ts
Last active Jun 23, 2019
Typescript weirdness
View index.ts
var a = require('./module1');
var b = require('./module2');
// import a from './module1';
// import b from './module2';
rjmunro / shim.js
Created May 15, 2015
Shim for console.log in IE9 when run without developer tools
View shim.js
// Shim console.log for IE9 when not run in with developer tools opened
// Stores log messages in window.consoleLog so you can retreive them when you open the tools.
(function () {
/*global window */
if (!window.console) {
window.consoleLog = [];
window.console = {
log: function (msg) {
window.consoleLog.push([msg, (new Date()).toIsoString()]);
rjmunro / average.php
Created Nov 4, 2014
PHP array_average function
View average.php
* Average an array
* I can't belive this isn't built in to PHP.
* @param float[] $array
* @return float
function array_average($array) {
return array_sum($array) / count($array);
rjmunro / .gitignore
Created Jun 21, 2013
gitignore for cordova cli projects
View .gitignore
# Android
# iOS
rjmunro / test-run.txt
Created Jun 10, 2013
Something funny is going on with CircleCI's build of php 5.3.20. I ran this test using their ssh console to try the other versions of PHP they have installed.
View test-run.txt
$ cd /home/ubuntu/.phpenv/versions/
$ for i in *; do echo; echo $i; $i/bin/php ~/test.php ; done
PHP Fatal error: Class 'IntlDateFormatter' not found in /home/ubuntu/test.php on line 2
Fatal error: Class 'IntlDateFormatter' not found in /home/ubuntu/test.php on line 2
PHP Deprecated: IntlDateFormatter::setTimeZoneId(): Use datefmt_set_timezone() instead, which also accepts a plain time zone identifier and for which this function is now an alias in /home/ubuntu/test.php on line 3
rjmunro / delay.js
Created May 21, 2013
Deferred wrapper around setTimeout. Lets you do: $.delay(100).then(function () { // some delayed action });
View delay.js
* Deferred wrapper around setTimeout. Lets you do:
* $.delay(100).then(function () {
* // some delayed action
* });
* @param time Delay time in ms.
* @return Deferred a promise that will complete after the time
jQuery.delay = function (time) {
var dfr = jQuery.Deferred();
def memoize(f):
cache= {}
def memf(*x):
if x not in cache:
cache[x] = f(*x)
return cache[x]
return memf
def sum_factors(x):
You can’t perform that action at this time.