Skip to content

Instantly share code, notes, and snippets.

@eddieajau
eddieajau / joomla_plugins.xml
Created January 28, 2013 01:37
Eclipse snippet category for Joomla plugins. Includes: Master Plugin File, XML Installation File (Plugin), Plugin method, Trigger plugin. Updated 2013-01-24
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<snippets>
<category filters="*" id="category_1278465230540" initial_state="1" label="Joomla Plugins" largeicon="" smallicon="">
<description><![CDATA[Snippets specifically for support Joomla modules.]]></description>
<item category="category_1278465230540" class="" editorclass="" id="item_1278465575233" label="Master Plugin File" largeicon="" smallicon="" snippetProvider="org.eclipse.wst.common.snippets.ui.TextSnippetProvider">
<description><![CDATA[Unnamed Template]]></description>
<content><![CDATA[jimport('joomla.plugin.plugin');
/**
* ${GROUP} ${NAME} Plugin.
@eddieajau
eddieajau / packaging.xml
Created January 28, 2013 01:44
Eclipse snippet category for packaging Joomla extensions. Includes: Basic installer class, SQL installation file header, XML installation supplement, XML administrator files, XML build file. Updated 2013-01-24
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<snippets>
<category filters="*" id="category_1311161288555" initial_state="1" label="Packaging" largeicon="" smallicon="">
<description><![CDATA[Snippets to assist with creating extension packages for distribution.]]></description>
<item category="category_1311161288555" class="" editorclass="" id="item_1311161491543" label="Basic installer class" largeicon="" smallicon="" snippetProvider="org.eclipse.wst.common.snippets.ui.TextSnippetProvider">
<description><![CDATA[The basic installer class that can be created in a installer.php file in the main directory of the extension.]]></description>
<content><![CDATA[/**
* @package ${PACKAGE}
* @subpackage ${SUBPACKAGE}
* @since ${SINCE}
@eddieajau
eddieajau / gist:4980010
Last active December 13, 2015 21:48
Draft Documentation Guide

Documentation Guide

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

@eddieajau
eddieajau / test.php
Created March 11, 2013 04:32
A strategy for mocking a PSR-3 logger. This assume the class being tested has a `log` method which probably checks if the logger has been set and then proxies to `$this->logger->log`.
use Psr\Log;
class TheTest extends \PHPUnit_Framework_TestCase
{
/**
* The class we are testing.
*/
protected $instance;
/**
@eddieajau
eddieajau / DataMapper.php
Created December 2, 2013 21:44
Data mappers
<?php
/**
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Data;
use Psr\Cache\CacheInterface;
@eddieajau
eddieajau / fw_release_strategy.md
Last active December 31, 2015 11:59
Joomla Framework Release Strategy

Joomla! Framework Release Strategy

1. Introduction

1.1 Revision History

Version Date Notes
1.0.0 16 December 2013 First version
@eddieajau
eddieajau / extractColumn.js
Created August 12, 2014 23:49
Extract a column from an array of JavaScript objects.
function extractColumn(arr, column) {
function reduction(previousValue, currentValue) {
previousValue.push(currentValue[column]);
return previousValue;
}
return arr.reduce(reduction, []);
}
@eddieajau
eddieajau / Collection.js
Created December 16, 2014 00:51
Clean architecture for basic entity CRUD in Node.
/**
* Collection Interface.
*
* Concrete implementations would exist INSIDE the boundary interfaces.
*
* - Must be able to add one or more entities to the collection.
* - Must be able to find entities in the collection.
* - Must be able update entities in the collection.
* - Must be able to remove entities from the collection.
*
@eddieajau
eddieajau / package.json
Created May 25, 2015 00:01
NPM Package Scripts
{
"devDependencies": {
"app-root-path": "^1.0.0",
"jshint": "^2.7.0",
"mocha": "^2.2.5",
"supertest": "^1.0.1"
},
"scripts": {
"check": "npm outdated",
"lint": "node_modules/.bin/jshint lib/ test/",
@eddieajau
eddieajau / waterline-error.md
Created August 3, 2015 23:23
Waterline validation error
model.create(someData)
  .catch(function (err) {
    console.error('ValidationError:', err.ValidationError);
    console.error('Message:', err.message);
  });

Outputs:

ValidationError: {