Skip to content

Instantly share code, notes, and snippets.

View veewee's full-sized avatar
👾
Parsing XML

Toon Verwerft veewee

👾
Parsing XML
View GitHub Profile
<?php
namespace Psalm\Tests\Template;
use Psalm\Tests\TestCase;
use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait;
class NeverTypeTest extends TestCase
{
use ValidCodeAnalysisTestTrait;
@veewee
veewee / grumphp.yaml
Last active June 9, 2020 05:09
GrumPHP on docker-compose
parameters:
git_hook_variables:
EXEC_GRUMPHP_COMMAND: docker-compose run --rm --no-deps php-fpm php
tasks:
phpcsfixer2:
config: ".php_cs.dist"
config_contains_finder: true
yamllint:
parse_custom_tags: true
phpunit: ~
@veewee
veewee / symfony-services.xsd
Created October 26, 2018 12:25
Symfony services XSD copy
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns="http://symfony.com/schema/dic/services"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://symfony.com/schema/dic/services"
elementFormDefault="qualified">
<xsd:annotation>
<xsd:documentation><![CDATA[
Symfony XML Services Schema, version 1.0
@veewee
veewee / NamespacedConstantsLookupBench.php
Last active August 20, 2018 05:42
NamespacedConstantsLookupBench.php
<?php
namespace {
\define( 'A', 'a' );
\define( 'B', 'b' );
}
namespace foo {
@veewee
veewee / composer-versions.json
Last active April 12, 2018 07:08
Composer - grumphp issue tester
[
{
"version": "1.6.3",
"sha256": "52cb7bbbaee720471e3b34c8ae6db53a38f0b759c06078a80080db739e4dcab6"
},
{
"version": "1.6.2",
"sha256": "6ec386528e64186dfe4e3a68a4be57992f931459209fd3d45dde64f5efb25276"
},
{
@veewee
veewee / .zshrc
Last active December 18, 2016 13:43
PHP Segfault aliases on mac
alias phpsegtrace='php -d xdebug.auto_trace=ON -d xdebug.trace_output_dir=/tmp/ -d xdebug.trace_output_name=phpsegtrace $@ || tail -n 50 /tmp/phpsegtrace.xt'
alias phpsegdbg='lldb php $@'
alias phpsegstrace='sudo dtruss php $@'
@veewee
veewee / converted-module.config.php
Created December 13, 2016 14:52
Relative ::class expectations
<?php
namespace Application;
use Application\Controller\IndexController;
use Application\Controller\HomeController;
use Application\Controller\ContactController;
return [
'controllers' => [
'invokables' => [
@veewee
veewee / README.md
Last active August 19, 2016 15:49
Demo Grumphp Satis server

How to run the satis server:

docker-compose up --build

How to use the satis server:

Watch the composer.json file as a sample.

@veewee
veewee / note.dtd
Created December 18, 2015 06:27
Used for XML validation tests
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
@veewee
veewee / commit-msg.sh
Last active August 25, 2024 05:43
Enforce the JIRA issue number in a GIT commit message
#!/bin/sh
# This hook will make sure that the commit message contains a JIRA issue.
#
# To enable this hook, rename this file to ".git/hooks/commit-msg".
# Make sure to add execution permissions to the file.
export MESSAGE=$(<$1)
export JIRA_ISSUE_TAG='ISSUETAG-([0-9]*)'
if [[ $MESSAGE =~ $JIRA_ISSUE_TAG ]]; then