Skip to content

Instantly share code, notes, and snippets.

[color]
branch = auto
diff = auto
status = auto
interactive = auto
[alias]
st = status
ci = commit
co = checkout
br = branch
@saro0h
saro0h / requirements.md
Last active October 19, 2015 19:02
Requirements for the tutorial at ZendCon 2015
http://places.cit.api.here.com/places/v1/discover/search?at=48.85031735791848,2.3450558593746678&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&q=%s
@saro0h
saro0h / fabfile.py
Created January 20, 2015 12:22
Example fabric script
from __future__ import with_statement
from fabric.api import *
from fabric.colors import *
from time import gmtime, strftime
def stage():
env.hosts = [
'user@127.0.1.1'
]
<?php
//…
/**
* @Route("/contact", name="contact_new")
* @Template
*/
public function indexAction(Request $request)
{
$contact = new Contact();
<?php
namespace Smoovio\Bundle\ApiBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\ParameterBag;
use Smoovio\Bundle\CoreBundle\Entity\Genre;
use Smoovio\Bundle\CoreBundle\Entity\Movie;
@saro0h
saro0h / kata_oauth.md
Last active August 29, 2015 14:08
Kata Oauth (use of the SimplePreAuthenticatorInterface)

Kata Authentication with Oauth

As a user, I need to be able to authenticate myself through Github.

[x] Use Github to authenticate the user (documentation: https://developer.github.com/v3/oauth/)
[x] I need to see the user currently authenticated.

Event Listener / Event Subscriber Kata

As a user, I need to make my website available between Sunday to friday.

 [X] Make an EventListener on kernel.request must be triggered as soon as possible
 [X] Don’t execute the logic if we aren’t in a master request 
 [X] Days of availability are configurable
 [X] Convert it to an EventSubscriber 

[X] Create a custom event with a method telling the triggered time