Skip to content

Instantly share code, notes, and snippets.

View havvg's full-sized avatar

Toni Uebernickel havvg

View GitHub Profile
@havvg
havvg / make-responsive.scss
Last active September 6, 2017 11:20
SCSS Mixin to create any content responsive
// Based on Twitter Bootstrap Mixins
@mixin make-responsive($prefix, $breakpoints: $grid-breakpoints) {
@each $breakpoint in map-keys($breakpoints) {
$infix: breakpoint-infix($breakpoint, $breakpoints);
@if $infix != "" {
@include media-breakpoint-down($breakpoint, $breakpoints) {
#{$prefix}#{$infix}-down {
@content;
@havvg
havvg / SimpleArrayTraversable.php
Last active August 15, 2017 16:19
A simple \Traversable based on an array
<?php
class SimpleArrayTraversable implements \IteratorAggregate
{
private $data;
public function __construct($a, $b, $c)
{
$this->data = [$a, $b, $c];
}
@havvg
havvg / redirect
Last active March 28, 2017 17:50
Doctrine: Nullable embeddables - workaround
https://github.com/tarifhaus/doctrine-nullable-embeddable
@havvg
havvg / TariffContext.php
Last active March 26, 2017 09:25
Behat: Expect exceptions
<?php
declare(strict_types=1);
namespace Thengine\Behat\Context\Domain\Tariff\Model;
use Behat\Behat\Context\Context;
use Thengine\Domain\Tariff\Model\Tariff;
use Thengine\Domain\Tariff\Model\TariffCategory;
use Thengine\Domain\Tariff\Exception\CannotRemoveCategoryException;
@havvg
havvg / .gitconfig
Last active March 26, 2017 18:34
Semantic Versioning: git latest-version
[alias]
latest-version = "!git tag --sort=v:refname | tail -n1"
@havvg
havvg / ZendKernel.php
Created December 29, 2016 20:50
StackPHP Example: Symfony + Zend Framework (ZF1)
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\TerminableInterface;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
class ZendKernel implements HttpKernelInterface, TerminableInterface
@havvg
havvg / diesel-preis.php
Created October 11, 2016 13:20
Diesel price of JET petrol station in Penzberg (melody script)
<?php
<<<CONFIG
packages:
- "fabpot/goutte: ^3.1"
- "symfony/console: ^3.1"
CONFIG;
use Goutte\Client;
use Symfony\Component\Console\Input\ArrayInput;
@havvg
havvg / zshrc
Created October 11, 2016 10:16
weather function calling wttr.in API
weather () {
CITY=${1-"Penzberg"}
curl "http://wttr.in/${CITY}"
}
@@ -37,7 +37,7 @@ final class MailHandler implements HandlerInterface
*
* @param \Swift_Mailer $mailer
* @param \Twig_Environment $twig
- * @param string|array $fromAddress The reply-to address is derived from this value, by default.
+ * @param string|array $fromAddress The reply-to address is derived from this value, by default
*/
public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $fromAddress)
{
Stage this hunk [y,n,q,a,d,/,e,?]? n
@havvg
havvg / clean-composer-vendors.sh
Created September 27, 2016 15:18
Clean up composer vendors directory
#!/bin/bash
find . -type f -name composer.json -maxdepth 4 -exec dirname {} \; | \
xargs -I{} find {} -type d -name vendor -maxdepth 1 | \
xargs rm -Rf