Skip to content

Instantly share code, notes, and snippets.

View havvg's full-sized avatar

Toni Uebernickel havvg

View GitHub Profile
@havvg
havvg / example.php
Created February 16, 2012 12:15
Example un-wrapped php-cctrl
<?php
require_once('autoload.php');
$cctrl = new Cloudcontrol\Api();
$user = new Cloudcontrol\Authentication\User('[email protected]', 'not-to-be-posted');
$app = new Cloudcontrol\Entity\Application('ormigo');
$deployment = new Cloudcontrol\Entity\Deployment($app, 'stage');
@havvg
havvg / php-cctrl-rewrite.php
Created February 17, 2012 18:50
Example wrapped php-cctrl
<?php
require_once('autoload.php.dist');
$api = new Cloudcontrol\Api();
$api
->setCredentials('[email protected]', 'yoursecretpasswd')
->setApplication('application')
->setDeployment('dep3as5l3')
;
 ormigo git:feature/cctrl-bundle ✗ ≠ ls -l src ~/Ormigo/repository/ormigo
total 0
drwxr-xr-x 3 havvg staff 102 Dec 12 14:33 FOS
drwxr-xr-x 5 havvg staff 170 Feb 18 01:05 Ormigo
 ormigo git:feature/cctrl-bundle ✗ ≠ ls -l src/Ormigo ~/Ormigo/repository/ormigo
total 0
drwxr-xr-x 11 havvg staff 374 Feb 13 14:39 Bundle
drwxr-xr-x 3 havvg staff 102 Nov 18 13:49 Monolog
drwxr-xr-x 3 havvg staff 102 Feb 18 01:56 Tests
 ormigo git:feature/cctrl-bundle ✗ ≠ ls -l src/Ormigo/Bundle ~/Ormigo/repository/ormigo
imports:
- { resource: parameters.yml }
- { resource: propel.yml }
- { resource: services.yml }
- { resource: security.yml }
# more stuff ...
@havvg
havvg / AbstractTest.php
Created February 18, 2012 16:12
Symfony2 DIC mock with services
<?php
namespace Havvg\Bundle\CloudcontrolBundle\Tests;
abstract class AbstractTest extends \PHPUnit_Framework_TestCase
{
// more stuff?
/**
* Return a mock object for the DI ContainerInterface.
<?php
class CriteriaTest extends BookstoreTestBase
{
public function testMultipleHaving()
{
$c = new Criteria();
$c->addSelectColumn(BookPeer::TITLE);
$c->addAsColumn('isb_n', BookPeer::ISBN);
$crit = $c->getNewCriterion('isb_n', '1234567890123');
@havvg
havvg / .gitconfig
Created March 2, 2012 21:00
git what's up?
[alias]
wu = branch -a --no-merged
@havvg
havvg / RegistrationController.php
Created March 8, 2012 15:54
CraueFormFlowBundle fill previous data when navigating steps
<?php
namespace Ormigo\Bundle\UserBundle\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use FOS\UserBundle\Controller\RegistrationController as Controller;
class RegistrationController extends Controller
{
// .. some more actions
@havvg
havvg / wizard.html.twig
Created March 15, 2012 10:41
Symfony2 Form CollectionType remove
{% extends '::base.html.twig' %}
{% from 'MopaBootstrapBundle::icons.html.twig' import icon %}
{% macro widget_prototype(widget, remove_text) %}
{% from 'MopaBootstrapBundle::icons.html.twig' import icon %}
{% if widget.get('prototype') %}
{% set form = widget.get('prototype') %}
{% set name = widget.get('prototype').get('name') %}
@havvg
havvg / .gitconfig
Created March 15, 2012 20:44
git up
[alias]
up = !git merge --ff-only upstream/`git branch --no-color | grep -e '^\\*' | cut -d\" \" -f2`