Skip to content

Instantly share code, notes, and snippets.

View juriansluiman's full-sized avatar

Jurian Sluiman juriansluiman

View GitHub Profile
@juriansluiman
juriansluiman / docker-compose.yml
Last active February 26, 2023 17:35
Traefik 2.2 with openvpn failover with udp+tcp protocol
version: '3'
networks:
web:
external: true
bridge:
external: true
services:
traefik:
@juriansluiman
juriansluiman / Readme.md
Last active March 17, 2016 09:06
Expl SlmMail

Transport vs service

Service is API client implementation. Does not correspond with any Zend\Mail transport interface. The HTTP transport class is an impl. of the Transport interface, accepting any of the SlmMail API client services. Actually, the SlmMail transport is a bridge between Zend Mail and all supported API service.

  1. Use the transport if you have previously have used Zend\Mail. It enables you to simply swap the Sendmail / SMTP transport and switch instantly to a 3rd party mail service
  2. Use the services if you only need the service implementation and have no need to further utilize Zend\Mail features

Using without Zend\Mail transport

@juriansluiman
juriansluiman / comments.tag
Created January 28, 2015 10:49
The react tutorial for riot
<comment-box>
<h1>{ opts.title }</h1>
<comment-list url={ opts.url } comments={ comments } />
<comment-form url={ opts.url } />
this.comments = []
add(comment) {
this.comments.push(comment)
@juriansluiman
juriansluiman / comments.tag
Last active August 29, 2015 14:14
Test riot-js file for a bug report
<comment-box>
<h1>{ opts.title }</h1>
<comment-list url={ opts.url } comments={ comments } />
<comment-form url={ opts.url } comments={ comments } />
// Start with some in-memory list of comments
this.comments = [{'name': 'Tom', 'message': 'Hi there'}, {'name': 'Paul', 'message': 'Great job'}]
</comment-box>
@juriansluiman
juriansluiman / keybase.md
Created December 26, 2014 08:18
Keybase.io identity verification

Keybase proof

I hereby claim:

  • I am juriansluiman on github.
  • I am jurian (https://keybase.io/jurian) on keybase.
  • I have a public key whose fingerprint is F425 765A F301 EE83 71B1 35BE 043B E044 6A20 6379

To claim this, I am signing this object:

<?php
namespace Foo;
use Zend\Http\Client as HttpClient;
use Zend\Http\Response as HttpResponse;
use Zend\Http\Exception\ExceptionInterface as HttpException;
use Zend\Json\Json;
@juriansluiman
juriansluiman / Tracker.js
Last active June 22, 2021 07:27
Track outbound links and form submits with Google Analytics Universal code
/**
* Create a Tracker module for Google Analytics
*
* This tracker enables to track clicks on links and submits on forms. Usually
* these events will not be recorded as the window.location is changed and the
* request to Google Analytics is cancelled. This module prevents default
* behaviour, tracks the Google Analytics event and then continues the link/submit.
*
* Data attributes are used to augment the event with category/action/label values.
* Use them as "data-track-category", "data-track-action" and "data-track-label".
<?php
class MyFactory implements FactoryInterface
{
public function createService()
{
$adapter = // get adapter based on config;
$service = new Service($adapter);
return $service;
}
@juriansluiman
juriansluiman / Module.php
Last active August 29, 2015 13:56
Return response on route
<?php
use Zend\Mvc\MvcEvent;
class Module
{
public function onBootstrap($e)
{
$app = $e->getApplication();
$sl = $app->getServiceManager();
$em = $app->getEventManager();
<?php
namespace MyModule\Service;
use ZfcRbac\Service\AuthorizationService as BaseAuthorizationService;
class AuthorizationService extends BaseAuthorizationService
{
protected $myDependency;