Skip to content

Instantly share code, notes, and snippets.

View manuelpichler's full-sized avatar

Manuel Pichler manuelpichler

View GitHub Profile
@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 / 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 $
<?php
/**
* This file is part of the static reflection component.
*
* PHP Version 5
*
* Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
<?php
// set up include path
set_include_path(realpath(__DIR__ . '/../pflow/lib/') . PATH_SEPARATOR . get_include_path() . PATH_SEPARATOR);
require_once 'staticReflection/Autoloader.php';
spl_autoload_register(array(new org\pdepend\reflection\Autoloader, 'autoload'));
require_once 'ReflectionFileSetQuery.php';
<?php
/**
* This file is part of the static reflection component.
*
* PHP Version 5
*
* Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manuelpichler
manuelpichler / gist:1393734
Created November 25, 2011 15:08
Detecting super globals
...
private $_superGlobals = array(
'$GLOBALS',
'$_SERVER',
'$_GET',
...
);
public function apply(PHP_PMD_AbstractNode $node)
{
@manuelpichler
manuelpichler / ugly_nowdoc.php
Created November 29, 2011 16:03
PHP is such an ugly language
<?php
class MyClass
{
static function myMethod(
$x = <<<'FOO'
Hello
FOO
, $y = <<<'BAR'
PHP_Depend
BAR
<response>
<document.id>42</document.id>
<document.name>Foo</document.name>
<document.desc>Foo Foo Foo Foo</document.desc>
<document.mail>foo@bar.de</document.mail>
<response>
<?php
trait A {
function f( ) {
return __METHOD__;
}
}
class C {
use A {