Skip to content

Instantly share code, notes, and snippets.

View amacgregor's full-sized avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
<?php
class NotificationManager {
public function sendNotification($type = '', $data)
{
switch($type){
case "email":
$notification = new EmailAdapter();
break;
<?php
class NotificationManager {
public function sendNotification(NotificationInterface $notification, $data)
{
$notification->setData($data);
$notification->sendNotification();
}
}
<?php
class Mage_Adminhtml_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
// echo $_product->getResource()->getAttribute('attribute name')->getFrontend()->getValue($_product)
public function __construct()
{
@amacgregor
amacgregor / Dockerfile
Created March 5, 2015 12:12
Example usage of amacgregor/base docker image
FROM amacgregor/base
MAINTAINER Allan MacGregor <[email protected]>
RUN mkdir -p /srv/www/
COPY config/vhosts/ /etc/apache2/sites-available
RUN a2ensite localhost.com.conf
@amacgregor
amacgregor / localhost.com.conf
Created March 5, 2015 12:18
Example vhost file for docker
Use VHost-PHP5.4 localhost.com * 80 localhost.com
docker run -v /home/amacgregor/Projects/DemacMedia/demac-docker-example/public:/srv/www/localhost.com/public_html
-p 127.0.0.1:80:80 -t -i amacgregor/localhost_com
grep -r "global/crypt/key" .
# Rna Transcription
Write a program that, given a DNA strand, returns its RNA complement (per RNA transcription).
Both DNA and RNA strands are a sequence of nucleotides.
The four nucleotides found in DNA are adenine (**A**), cytosine (**C**),
guanine (**G**) and thymine (**T**).
The four nucleotides found in RNA are adenine (**A**), cytosine (**C**),
@amacgregor
amacgregor / composer.json
Created March 31, 2015 09:31
Composer file for robot-name exercise
{
"name": "amacgregor/robot-name",
"authors": [
{
"name": "Allan MacGregor",
"email": "[email protected]"
}
],
"require": {
"icomefromthenet/reverse-regex" : "dev-master"
<?php
namespace Goose\Modules\Formatters;
use Goose\Article;
use Goose\Traits\NodeCommonTrait;
use Goose\Traits\NodeGravityTrait;
use Goose\Traits\ArticleMutatorTrait;
use Goose\Modules\AbstractModule;
use Goose\Modules\ModuleInterface;