Skip to content

Instantly share code, notes, and snippets.

View manuelpichler's full-sized avatar

Manuel Pichler manuelpichler

View GitHub Profile
#!/bin/sh
DIR="`pwd`"
while [ ! -e "${DIR}/vagrant/Vagrantfile" ] && [ "" != "${DIR}" ] && [ "/" != "${DIR}" ]
do
#echo "${DIR}"
DIR=`dirname "${DIR}"`
done
Host *
ForwardAgent yes
Compression yes
@manuelpichler
manuelpichler / bash
Created January 9, 2015 11:15
PHPMD ShortVariable exception list
manu@Samweis PHP_PMD-git $ src/bin/phpmd --version
PHPMD 2.2.0
manu@Samweis PHP_PMD-git $ src/bin/phpmd /tmp/short.php text /tmp/naming.xml
manu@Samweis PHP_PMD-git $
@manuelpichler
manuelpichler / zoneminder
Created August 28, 2014 06:22
Simple start/stop script for ZoneMinder
#!/bin/bash
progName="ZoneMinder environment"
start() {
echo "Starting ${progName}"
sudo /etc/init.d/zoneminder start
sudo /etc/init.d/apache2 start
}
@manuelpichler
manuelpichler / immutable.php
Last active December 21, 2015 17:49
Immutable objects and the builder pattern.
<?php
interface ImmutableObject {
public function getMandatory();
public function getOptional();
}
interface ImmutableObjectBuilder {
public function setOptional($optional);
@manuelpichler
manuelpichler / build.xml
Created November 23, 2012 12:47
Custom ABC environments
<?xml version="1.0" ?>
<project name="sindelfingen" default="test">
<!-- Set default if not specified on cli -->
<property name="sindelfingen.env" value="default" />
<property file="${sindelfingen.env}.properties" />
<import file="setup/src/main/xml/base.xml" />
</project>
@manuelpichler
manuelpichler / Symfony2BarRule.php
Created April 13, 2012 16:59
PHPMD Symfony base class
<?php
class My_Custom_Symfony2BarRule extends My_Custom_Symfony2BaseRule
{
protected function doApply($class) {}
}
@manuelpichler
manuelpichler / gist:2378294
Created April 13, 2012 16:50
Custom PHPMD rule
<?php
class My_Custom_Symfony2Rule extends PHP_PMD_Rule implements PHP_PMD_Rule_IClassAware
{
public function apply($class)
{
// Skip here
if (false === $this->isController($class)) {
return;
}
Index: tests/environment.php
===================================================================
--- tests/environment.php (Revision 26)
+++ tests/environment.php (Arbeitskopie)
@@ -1,6 +1,6 @@
<?php
-function __autoload( $classname )
+spl_autoload_register( function( $classname )
{
@manuelpichler
manuelpichler / gist:1852825
Created February 17, 2012 11:29
PHP_Depend max nesting configuration
<?xml version="1.0"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://pdepend.org/schema/configuration"
xsi:schemaLocation="http://pdepend.org/schema/configuration http://pdepend.org/schema/1.0/configuration.xsd">
<parser>
<nesting>423</nesting>
</parser>
</configuration>