Skip to content

Instantly share code, notes, and snippets.

View djun-kim's full-sized avatar

Djun Kim djun-kim

View GitHub Profile
@djun-kim
djun-kim / gist:f211ef5d056696dafd4b
Created March 12, 2015 17:14
Drush command to debug long-running cron jobs (from Tim Millwood)
# http://www.millwoodonline.co.uk/blog/drupal-cron-failing-not-sure-why-heres-handy-drush-command
drush php-eval ' global $timers; $hook = 'cron'; $return = array(); foreach (module_implements($hook) as $module) { $function = $module . '_' . $hook; print($function ." - "); timer_start($function); $args = array(); $result = call_user_func_array($function, $args); if (isset($result) && is_array($result)) { $return = array_merge_recursive($return, $result); } else if (isset($result)) { $return[] = $result; } timer_stop($function); print($timers[$function]['time'] ."\r\n"); }'
@djun-kim
djun-kim / r-test-prob-01.pg
Created March 10, 2013 19:51
WeBWorK Rserve Integration sample problem
##DESCRIPTION
## Test rserve client
##ENDDESCRIPTION
##KEYWORDS('rserve')
## DBsubject('Statistics')
## DBchapter('Descriptive Statistics')
## DBsection('Mean')
## Date('13/11/2012')
@djun-kim
djun-kim / course.conf
Created March 10, 2013 19:44
Sample WeBWorK Course Config File for Rserve integration
#!perl
################################################################################
# WeBWorK Online Homework Delivery System
# Copyright � 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of either: (a) the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any later
# version, or (b) the "Artistic License" which comes with this package.
#
@djun-kim
djun-kim / gist:5130048
Created March 10, 2013 19:33
RserveClient.pl - WeBWorK Module for R integration
=head1 NAME
RserveClient.pl - Macros for querying an Rserve server (see R-project.org)
=head1 SYNPOSIS
Example: generate a normally distributed vector of 15 elements,
with mean 1, standard deviation 2, rounded to 4 decimal places.
$m = 1;