Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Potthast danielpotthast

View GitHub Profile
@danielpotthast
danielpotthast / default.vcl
Created May 26, 2018
Varnish Konfiguration
View default.vcl
vcl 4.0;
# Default backend definition. Set this to point to your content server.
backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
@danielpotthast
danielpotthast / 20-https.conf
Last active May 19, 2019
NGINX – HTTPS-Konfiguration
View 20-https.conf
# Varnish Upstream with NGINX Fallback
upstream wordpress-varnish {
server 127.0.0.1:6081 weight=5 max_fails=1 fail_timeout=5s;
server 127.0.0.1:8080 backup;
}
# HTTPS Server
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
View sblum-symfony--testproductlist.php
<?php
class ProductListTest extends \PHPUnit_Framework_TestCase
{
public function testProductList()
{
$listedProduct = $this->prophesize(ProductListInterface::class);
$listedProduct->isListed()->willReturn(true);
$notListedProduct = $this->prophesize(ProductListInterface::class);
$notListedProduct->isListed()->willReturn(false);
View sblum-symfony--config-swiftmailer-gmail.yaml
swiftmailer:
transport: gmail
username: me@gmail.com
password: myGmailPassword
View sblum-symfony--newsletter-manager-snippet.php
$newsletterManager = $this->get('newsletter_manager');
$newsletterManager->send($recipients, $message);
View sblum-symfony--newsletter-class-test.php
<?php
class Newsletter
{
private $mailer;
public function __construct()
{
$this->mailer = new Mailer('news@demo.de','Demo News','Reply-To: reply@demo.de');
}
View sblum-symfony--newsletter-manager-testdriven.php
<?php
namespace Demo;
class NewsletterManager
{
private $mailer;
public function setMailer(MailerInterface $mailer)
{