Skip to content

Instantly share code, notes, and snippets.

View Akii's full-sized avatar
🚀
To the Moon

Akii

🚀
To the Moon
View GitHub Profile
public function createQuery() {
$query = parent::createQuery();
$constraintQuery = new ConstraintedQuery($query);
$constraintQuery->setDefaultConstraint(
$query->whatever()
)
return $constraintQuery;
}
@Akii
Akii / Video.txt
Last active August 29, 2015 14:19
Some thoughts about what you could cover in a video about eventstore.
If you have explained some things already, I'm sorry - even though I watched
all your videos, I might oversaw some details or forgot :D
- Stream Names
-> convention that you have aggregate type - identifier
-> what about renaming?
- Projections
-> you held a talk about that, but some short examples would be nice
@Akii
Akii / component.modal-dialog.js
Last active August 29, 2015 14:19
Really simple ember modal implementation
import Ember from 'ember';
export default Ember.Component.extend({
modal: undefined,
show: false,
setupModal: function() {
var modal = this.$('.modal').modal({
show: this.get('show'),
{{textarea value=markdown rows="10" class="form-control"}}
<?php
namespace Hypu;
class HypeConverter extends AbstractTypeConverter {
protected $sourceTypes = ['pre_13:37_Hype'];
protected $targetType = 'post_13:37_Hype';
}
<?php
namespace Akii\RememberMe\Security\Authentication\Aspect;
use Akii\RememberMe\Security\Authentication\Token\RememberMeToken;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Aop\JoinPointInterface;
use TYPO3\Flow\Configuration\ConfigurationManager;
use TYPO3\Flow\Http\Cookie;
use TYPO3\Flow\Http\Request;
use TYPO3\Flow\Http\Response;
def isSorted[A](as: Array[A], ordered: (A,A) => Boolean): Boolean = {
if (as.length <= 1) true
else {
@annotation.tailrec
def checkSort(n: Int): Boolean = {
if (n >= as.length) true
else if (!ordered(as(n - 1), as(n))) false
else checkSort(n+1)
}
def dropWhile[A](l: List[A], f: A => Boolean): List[A] = {
if (f(l.head)) l
else dropWhile(tail(l), f)
}
def tail[A](l: List[A]): List[A] = l match {
case Nil => Nil
case Cons(_, t) => t
}
case class ValueObject(property: SomeType)
class ValueObject {
/** @var SomeType */
protected $property;
/** @param SomeType $property
public function __construct(SomeType $property) {
$this->property = $property;
}