Slim/Stylus/Coffee
A Pen by Billy Moon on CodePen.
Slim/Stylus/Coffee
A Pen by Billy Moon on CodePen.
var module = { | |
exports : {} | |
} | |
YUI.add('dlp-jquery-commonjs', function(Y) { | |
function getFile(url) { | |
if (window.XMLHttpRequest) { | |
AJAX=new XMLHttpRequest(); | |
} else { |
/** | |
* Manipulate text inside HTML according to passed function | |
* @param html the html string to manipulate | |
* @param manipulator the funciton to manipulate with (will be passed single word) | |
* @returns manipulated string including unmodified HTML | |
* | |
* Currently limited in that manipulator operates on words determined by regex | |
* word boundaries, and must return same length manipulated word | |
* | |
*/ |
CREATE TABLE IF NOT EXISTS `purchases` (`Purchase_ID` int(11), `Datetime` datetime, `Reward_ID` int(11), `Quantity` int(11), `Student_ID` int(11), `Student_Name` varchar(100), `Date_DealtWith` datetime, `Date_Collected` datetime); | |
DELETE FROM `purchases`; | |
INSERT INTO `purchases` (`Purchase_ID`, `Datetime`, `Reward_ID`, `Quantity`, `Student_ID`, `Student_Name`, `Date_DealtWith`, `Date_Collected`) VALUES | |
(1, '2011-09-27 16:55:16', 1, 1, 34240, '', '2011-09-27 16:55:16', '2011-12-12 15:45:43'), | |
(2, '2011-09-28 13:02:26', 1, 1, 137636, '', '2011-09-27 16:55:16', '2011-09-27 16:55:16'), | |
(3, '2011-09-29 11:29:09', 1, 1, 137685, '', NULL, NULL), | |
(4, '2011-09-29 11:29:09', 1, 1, 928734, '', NULL, NULL); |
/* Need to add www-data to group shadow (and restart apache) | |
$ sudo adduser www-data shadow | |
$ sudo /etc/init.d/apache2 restart | |
Needs whois to be installed to run mkpasswd | |
$ sudo apt-get install whois | |
Assumes that sha-512 is used in shadow file | |
*/ | |
function authenticate($user, $pass){ | |
// run shell command to output shadow file, and extract line for $user |
$.hook = function (fns){ | |
fns = typeof fns === 'string' ? fns.split(' ') : $.makeArray(fns); | |
jQuery.each( fns, function (i, method) { | |
var old = $.fn[ method ]; | |
if( old && !old.__hookold ){ | |
$.fn[ method ] = function(){ | |
this.triggerHandler('onbefore'+method); | |
this.triggerHandler('on'+method); | |
var ret = old.apply(this, arguments); | |
this.triggerHandler('onafter'+method); |