Skip to content

Instantly share code, notes, and snippets.

View havvg's full-sized avatar

Toni Uebernickel havvg

View GitHub Profile
<?php
class Person
{
private $firstName;
private $lastName;
public function name()
{
return $this->firstName.' '.$this->lastName;
@havvg
havvg / is_it_bem.html
Created September 1, 2016 12:08
What do you think, BEM?
<div class="personal-contact-list">
<div class="personal-contact-list__entry personal-contact personal-contact--project-manager">
<div class="personal-contact__avatar">
<img src="http://../3dda094b8e16392ae2003e888b68de15.jpeg" title="Toni Uebernickel">
</div>
<div class="personal-contact__contact-form">
<form method="post">
<!-- Some contact form -->
</form>
</div>
@havvg
havvg / EierlegendeWollmilchSauInterface.php
Created August 25, 2016 18:03
Eierlegende Wollmilchsau
<?php
/**
* Contract: An implementation of this interface MUST NOT throw any exception but deal with everything
*/
interface EierlegendeWollmilchSauInterface
{
}
@havvg
havvg / .zshrc
Created July 19, 2016 06:33
naive homebrew php-switch
# Disables any PHP by unlinking all PHP versions and stopping all PHP services
#
# Enables the PHP of the provided version.
# If no version is provided, no PHP will be enabled, effectively disabling homebrew PHP.
#
# Usage: php-switch 70
php-switch() {
brew list | grep -e ^php..$ | xargs brew unlink
brew services list | grep started | cut -d" " -f1 | grep -e ^php | xargs brew services stop
<?php
namespace Application\Request\ParamConverter;
use Application\Domain\User\Model\User;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
use Symfony\Component\HttpFoundation\Request;
/**

Keybase proof

I hereby claim:

  • I am havvg on github.
  • I am havvg (https://keybase.io/havvg) on keybase.
  • I have a public key ASBzyW3BS1satXFCwOlrTSrKQPOakDHjkE-lDepqLbLx3go

To claim this, I am signing this object:

let eventBus = new Vue()
new Vue({
el: '#application',
replace: true,
template: '<app :event-bus="eventBus" :websocket-url="websocketUrl"></app>',
data: {
eventBus: eventBus,
websocketUrl: websocketUrl
}
@havvg
havvg / .gitconfig
Last active November 4, 2019 12:03
[core]
editor = mate -w -l 1
excludesfile = ~/.gitignore
whitespace = trailing-space,space-before-tab,-indent-with-non-tab,tab-in-indent,tabwidth=2
autocrlf = input
ignorecase = true
[diff]
patience = true
algorithm = patience
[notes]
@havvg
havvg / Firewall.js
Last active March 1, 2024 11:52
ExtJS 6: JSON Web Token API Login with Promises
Ext.define('App.security.Firewall', {
singleton: true,
requires: [
'App.security.TokenStorage'
],
isLoggedIn: function() {
return null !== App.security.TokenStorage.retrieve();
},
@havvg
havvg / CommandContext.php
Created May 30, 2015 10:07
BDD: Create User Command
<?php
namespace Trnd\Behat\Context\Console;
use Behat\Behat\Context\Context;
use Mockery\MockInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;