Skip to content

Instantly share code, notes, and snippets.

View mpdude's full-sized avatar
💭
Coding

Matthias Pigulla mpdude

💭
Coding
View GitHub Profile
@mpdude
mpdude / apache-2.2-mod_remoteip.c
Created December 3, 2011 13:04 — forked from bfg/apache-2.2-mod_remoteip.c
Working backport (doesn't crash when using Allow/Deny ACLs) of Apache 2.3 module mod_remoteip to Apache 2.2.x
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mpdude
mpdude / gist:5825777
Last active December 18, 2015 18:29
Quick proof-of-concept patch for composer/composer#2022
diff --git a/src/Composer/DependencyResolver/RuleSetGenerator.php b/src/Composer/DependencyResolver/RuleSetGenerator.php
index b40ce1a..2255c36 100644
--- a/src/Composer/DependencyResolver/RuleSetGenerator.php
+++ b/src/Composer/DependencyResolver/RuleSetGenerator.php
@@ -12,6 +12,7 @@
namespace Composer\DependencyResolver;
+use Composer\Package\LinkConstraint\MultiConstraint;
use Composer\Package\PackageInterface;
@mpdude
mpdude / gist:7372480
Created November 8, 2013 15:18
Pushing the ConsoleHandler to the Monolog "app" logger instance in Symfony2
<?php
// ... see http://symfony.com/doc/current/components/console/introduction.html#creating-a-basic-command
namespace Acme\DemoBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Bridge\Monolog\Handler\ConsoleHandler;
@mpdude
mpdude / gist:7590059
Created November 21, 2013 21:32
mod_rpaf configuration for transparent SSL termination on EC2 ELBs
LoadModule rpaf_module modules/mod_rpaf.so
<IfModule mod_rpaf.c>
RPAF_Enable On
RPAF_ProxyIPs 10.0.0.0/8
RPAF_SetPort On
RPAF_SetHTTPS On
</IfModule>
@mpdude
mpdude / phpunit.xsd
Last active December 29, 2015 02:28
XML Schema für PHPUnit
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Defines a xml schema for PHPUnit xml configuration files as described in
- the official PHPUnit documentation at:
- http://www.phpunit.de/manual/current/en/appendixes.configuration.html
-
- @author Matthias Molitor <matthias@matthimatiker.de>
- @version $Rev: 371 $
- @since 02.03.2011
-->
<?php
namespace Webfactory\Bundle\PagesBundle\Tests;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Persistence\ObjectRepository;
@mpdude
mpdude / Portfile
Created April 16, 2014 08:22
MacPorts Portfile for APCu
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: $
PortSystem 1.0
PortGroup php 1.1
name php-APCu
version 4.0.4
categories php devel
@mpdude
mpdude / gulpfile.js
Last active August 11, 2017 13:00
Gulp für Assetic-Veteranen
var phlough = require("./conf/phlough-configuration.json");
var gulp = require('gulp');
var $ = require('gulp-load-plugins')(); /// lädt alle gulp-*-Module in $.*
var mergeStream = require('merge-stream');
var path = require('path');
var saveLicense = require('uglify-save-license');
var autoprefixer = require('autoprefixer');
var config = {
@mpdude
mpdude / 0004-oversize-dns.diff
Created November 10, 2014 10:12
Patch Ubuntu netqmail-1.06 to handle DNS packets >512 byte and remove unneeded CNAME checks
--- qmail-1.03/dns.c.103 Mon Aug 17 16:06:58 1998
+++ qmail-1.03/dns.c Wed Aug 26 16:28:56 1998
@@ -21,10 +21,12 @@
static unsigned short getshort(c) unsigned char *c;
{ unsigned short u; u = c[0]; return (u << 8) + c[1]; }
-static union { HEADER hdr; unsigned char buf[PACKETSZ]; } response;
+static struct { unsigned char *buf; } response;
+static int responsebuflen = 0;
static int responselen;
@mpdude
mpdude / phpstorm-init-vcs-roots
Created November 11, 2014 11:42
Initialize .idea/vcs.xml file with all Git or Mercurial repos below current directory
#!/usr/bin/env php
<?php
print <<<HEAD
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
HEAD;