Skip to content

Instantly share code, notes, and snippets.

View johnfuller's full-sized avatar
🏠
Working from home

John Fuller johnfuller

🏠
Working from home
  • Dumaguete, Philippines
View GitHub Profile
define(function(require, exports, module) {
main.consumes = [
"Plugin", "c9", "tabManager", "preferences", "settings", "save", "ace",
"proc", "info", "http", "notification.bubble", "Dialog", "ui"
];
main.provides = ["wakatime"];
return main;
function main(options, imports, register) {
var Plugin = imports.Plugin;
<?php
/**
* Custom configuration bootsrtap file for ExpressionEngine
*
* Place config.php in your site root
* Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
* Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
* If you have moved your site root you'll need to update the require_once path
*
@johnfuller
johnfuller / PHP Date helpers
Created March 3, 2011 08:13
Helpful functions to figure out future dates to days, months, years. Stolen from PHP.net comments for mktime.
<?php
public function addMonthToDate($timeStamp, $totalMonths=1){
// You can add as many months as you want. mktime will accumulate to the next year.
$thePHPDate = getdate($timeStamp); // Covert to Array
$thePHPDate['mon'] = $thePHPDate['mon']+$totalMonths; // Add to Month
$timeStamp = mktime($thePHPDate['hours'], $thePHPDate['minutes'], $thePHPDate['seconds'], $thePHPDate['mon'], $thePHPDate['mday'], $thePHPDate['year']); // Convert back to timestamp
return $timeStamp;
}
public function addDayToDate($timeStamp, $totalDays=1){