Skip to content

Instantly share code, notes, and snippets.

View wouterj's full-sized avatar

Wouter de Jong wouterj

View GitHub Profile
default:
suites:
portal:
contexts: [Behat\MinkExtension\Context\MinkContext, PortalContext]
path: %paths.base%/features
extensions:
Behat\MinkExtension:
base_url: http://st3hoekcp-acc.wonenportaal.nl/
sessions:
default:
<?hh
/*-------------------------*\
PROGRAMMING
WITH
NOTHING
\*-------------------------*/
/*
* A heavily based on http://codon.com/programming-with-nothing
*/
and(A, A, A).
and(A, B, 0) :- A \= B.
or(1, 0, 1).
or(0, 1, 1).
or(1, 1, 1).
or(0, 0, 0).
xor(1, 0, 1).
xor(0, 1, 1).
<?php
describe('StringCalculator', function () {
it('requires string output', function () {
$this->shouldThrow('\InvalidArgumentException')->during('add', [null]);
});
it('adds 2 numbers separated by comma', function () {
$this->add('1,2')->shouldReturn(3);
---
layout: default
title: Category Archive
generator: [posts_category_index, pagination]
pagination:
provider: page.category_posts
---
{% block title %}{{ page.title }} "{{ page.category }}"{% endblock %}
{% block content %}
<?php
Route::get('/hello-mail/{name}', function ($name) {
Mail::send('emails.hello', array('name' => $name), function ($message) {
$message->to('foo@example.com', 'Foo')->subject('Someone visited /hello-mail/');
});
});
# formats array
formats = {
# ...
'varnish-3': 'Varnish 3',
'varnish-4': 'Varnish 4'
}
"""
in conf.py
"""
<?php
use Symfony\Component\HttpFoundation\Request;
// deze inject je
$router = ...; // router
$accessMap = ...; // security.access_map
$accessDecisionManager = ...; // security.access.decision_manager
$route = 'admin_homepage';
$url = $router->generate($route);
<?php
interface LineNumber
{
function getLineNumber($currentLineNumber);
}
class RelativeLineNumber implements LineNumber
{
private $linesDelta;
<?php
require_once __DIR__.'/../vendor/autoload.php';
use Gnugat\Redaktilo\Filesystem;
use Gnugat\Redaktilo\Editor;
use Gnugat\Redaktilo\File;
use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem;
$symfonyFilesystem = new SymfonyFilesystem();