This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Drupal 7.22 | |
// If there's an easier way please let me know | |
/** | |
* Swap out a form error message. | |
* | |
* This must be done with the actual message comparison since error keys | |
* are not stored in drupal messages. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var randomBgHex = '#' + ('000000' + Math.floor(Math.random()*16777215).toString(16)).slice(-6); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns the number rounded to the nearest interval. | |
* Example: | |
* | |
* roundToNearest(80, 100); // 100 | |
* roundToNearest(25, 15); // 30 | |
* | |
* @param {number} value The number to round | |
* @param {number} interval The numeric interval to round to | |
* @return {number} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get an RSS pubDate from a Javascript Date instance. | |
* @param Date - optional | |
* @return String | |
*/ | |
function pubDate(date) { | |
if (typeof date === 'undefined') { | |
date = new Date(); | |
} |
NewerOlder