Skip to content

Instantly share code, notes, and snippets.

View acelaya's full-sized avatar
🖥️
Coding

Alejandro Celaya acelaya

🖥️
Coding
View GitHub Profile
@acelaya
acelaya / keybase.md
Created September 22, 2014 20:32
keybase.md

Keybase proof

I hereby claim:

  • I am acelaya on github.
  • I am acelaya (https://keybase.io/acelaya) on keybase.
  • I have a public key whose fingerprint is D736 DA46 5EF0 4830 31D9 0F73 F3FE 9ED9 D900 89FE

To claim this, I am signing this object:

@acelaya
acelaya / MyRoleProvider.php
Created March 5, 2015 16:29
Role provider example
<?php
namespace Application\Provider;
use TrascastroACL\Provider\RoleProviderInterface;
use Zend\Authentication\AuthenticationServiceInterface;
use Application\Entity\User;
class MyRoleProvider implements RoleProviderInterface
{
private $authService;
@acelaya
acelaya / TableAbstractFactory.php
Last active January 19, 2016 15:57
AbstractFactories to create TableGateways
<?php
namespace Application\Service\Factory;
use Zend\ServiceManager\AbstractFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class TableGatewayAbstractFactory implements AbstractFactoryInterface
{
/**
* Determine if we can create a service with name
@acelaya
acelaya / FACTORIES.md
Created July 21, 2017 14:54
Reusing factories in zend-servicemanager

There are several situations in which it is possible to reuse the same factory to create an object.

Same dependencies

The simplest one is when the objects share the same dependencies. For example, imagine your app uses one TableGateway to manage every DB table. Each one of them will need a database adapter to be injected on it.

Instead of creating one factory for every TableGateway, you can create just one with this content

class TableGatewayFactory
@acelaya
acelaya / pre-buildx.sh
Created October 31, 2020 10:20
Before docker buildx
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --use
# Then docker buildx build should work
# docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 .
@acelaya
acelaya / keybase.md
Created July 25, 2021 06:39
keybase.md

Keybase proof

I hereby claim:

  • I am acelaya on github.
  • I am acelaya (https://keybase.io/acelaya) on keybase.
  • I have a public key ASCgDxMv45xrriDgnKbN1bYIhdxZRB9FXQM97aCN4mm7cAo

To claim this, I am signing this object: