- Unique Headers
- Simple Page Sidebars
- Akismet
- AntiVirus
- Block Bad Queries (BBQ)
- Wordfence Security
javascript:(function(){document.body.style.overflow = 'visible';})(); |
<?php | |
/** | |
* Alternative controller file - this one is actually loaded, though I'm forced to put it somewhere silly. | |
* (installed at concrete/blocks/external_form/form/controller/contact_form.php) | |
*/ | |
namespace Concrete\Block\ExternalForm\Form\Controller; | |
class ContactForm extends \Concrete\Core\Controller\AbstractController |
/** | |
* Given two dates (or one date and assume "now" for the second), convert this to | |
* a human-readable string, like "2 months". | |
* | |
* I use this to put "3 months ago" strings into plugins. My use case has the date | |
* coming in as a seconds-only UNIX epoch, so the params are expected at this. | |
* | |
* @param time1 integer Number of seconds since UNIX epoch | |
* @param time2 integer Number of seconds since UNIX epoch | |
* @return string |
// A bunch of functions you can use in the MongoDB shell | |
// taken from http://api.mongodb.org/js/1.8.2/index.html | |
// amongst other sources | |
// Used in place of print() to view the contents of objects | |
printjson(x); | |
printjsononeline(x); | |
// File system interaction | |
ls(...); |
<?php | |
/** | |
* Round a decimal to the nearest half, so: | |
* 0 becomes 0 | |
* 0.2 becomes 0 | |
* 1 becomes 1 | |
* 2.5 becomes 2.5 | |
* 2.51 becomes 2.5 | |
* 2.49 becomes 2.5 |
<?php | |
class Date | |
{ | |
/** | |
* Returns time difference between two timestamps, in human readable format. | |
* | |
* @param int $time1 A timestamp. | |
* @param int $time2 A timestamp, defaults to the current time. | |
* @param string $output Formatting string specifying which parts of the date to return in the array. |
<?php | |
/** | |
* Parse a number of seconds into a more readable format. | |
* | |
* @param int $seconds Length of time. | |
* @param string $minSeparator Placed between min and second values. | |
* @param string $hourSeparator Placed between hour and minute values. | |
* @return string | |
*/ |
<!-- | |
Holmes.css bookmarklet | |
Adds the holmes tests (see https://github.com/redroot/holmes) to any page at a click of a button | |
Usage instructions: | |
1. Install the latest version of holmes on your local/personal web server | |
2. Create a new HTML page containing the contents of this Gist | |
3. Edit the href to holmes in the source, if your holmes stylesheet is not located at http://localhost/tools/holmes.min.css | |
4. Open the HTML page in your browser, and drag the bookmarklet to your bookmarks bar |