Skip to content

Instantly share code, notes, and snippets.

View delboy1978uk's full-sized avatar

Derek Stephen McLean delboy1978uk

View GitHub Profile
<?php
class Image {
protected $_image;
protected $_image_type;
/**
* @param string $filename
/**
* Now with added Transparency resizing feature
* @param int $width
* @param int $height
*/
public function resize($width,$height)
{
$new_image = imagecreatetruecolor($width, $height);
if ( ($this->getImageType() == IMAGETYPE_GIF) || ($this->getImageType() == IMAGETYPE_PNG) )
<?php
use Website\Controller\Action;
use Website\Form\Contact as ContactForm;
use Object\Enquiry;
class DefaultController extends Action
{
public function defaultAction()
import UIKit
class ViewController: UIViewController, UITableViewDelegate
{
@IBOutlet weak var number: UILabel!
@IBOutlet weak var slider_value: UISlider!
@IBOutlet weak var table: UITableView!
@IBAction func sliderMoved(sender: AnyObject)
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
UNION
<?php
namespace HtUserRegistration\Service;
use HtUserRegistration\Mapper\UserRegistrationMapperInterface;
use Zend\EventManager\EventInterface;
use ZfcUser\Entity\UserInterface;
use ZfcBase\EventManager\EventProvider;
use DateTime;
use HtUserRegistration\Entity\UserRegistrationInterface;
use HtUserRegistration\Mailer\MailerInterface;
public function onBootstrap(MvcEvent $e)
{
$app = $e->getApplication();
$eventManager = $app->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
$sharedManager = $eventManager->getSharedManager();
$sharedManager->attach('HtUserRegistration\Service\UserRegistrationService', 'createRegistrationRecord.post', function (MvcEvent $event) use ($app) {
die("OK we seem to be getting somewhere?");
});
public function onBootstrap(MvcEvent $e)
{
$app = $e->getApplication();
$eventManager = $app->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
$sharedManager = $eventManager->getSharedManager();
$sharedManager->attach('HtUserRegistration\Service\UserRegistrationService', 'createRegistrationRecord.post', function (Event $e) use ($app) {
$controller = $e->getTarget();
$controller->redirect()->toRoute('checkemailtoactivate');
public function onBootstrap(MvcEvent $e)
{
$app = $e->getApplication();
$eventManager = $app->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
$sharedManager = $eventManager->getSharedManager();
$sharedManager->attach('HtUserRegistration\Service\UserRegistrationService', 'createRegistrationRecord.post', function (Event $e) use ($app) {
$e->stopPropagation(true);
//->controller->redirect()->toRoute('checkemailtoactivate');
@delboy1978uk
delboy1978uk / satis_github_auth.sh
Last active August 29, 2015 14:27 — forked from h4cc/satis_github_auth.sh
Some notes on how to authenticate with composer/satis against github oauth, so the rate limit of 60 will be raised op to 5000. Can also be used for travis-ci.
# Create a new Token
curl -u 'githubuser' -d '{"note":"Your Application"}' https://api.github.com/authorizations
# It is: "ebab4dc37e654bb230a9c69ebcd5f38e9a81e210"
#{
# "created_at": "2013-01-04T18:00:28Z",
# "app": {
# "url": "http://developer.github.com/v3/oauth/#oauth-authorizations-api",