Skip to content

Instantly share code, notes, and snippets.

@hpbuniat
hpbuniat / svn-version.php
Last active December 15, 2015 00:39
Get all versions of a specific file from svn
<?php
/**
* SVN-Version extractor of a specific file
*
* Get all versions of a specific file from svn
*/
// argument-handling
$aArgs = getopt('f:p:r:');
$iRevision = (true === empty($aArgs['r'])) ? 'HEAD' : $aArgs['r'];
@hpbuniat
hpbuniat / namespaceRefactor.php
Last active April 3, 2021 22:33
Super-simple script to convert a existing project to use namespaces
<?php
/**
* Super-simple script to convert a existing project to use namespaces
*
* @author Hans-Peter Buniat <hpbuniat@googlemail.com>
* @copyright 2012 Hans-Peter Buniat <hpbuniat@googlemail.com>
* @license http://opensource.org/licenses/BSD-3-Clause
*/
class namespaceRefactor {
@hpbuniat
hpbuniat / tracAge.php
Created June 14, 2012 06:43
Read the latest modification date of a number of tracs
<?php
/**
* Read the latest modification date of a number of tracs
*/
class tracTest {
/**
* The http-client to use (w/ auth)
*
* @var Zend_Http_Client
@hpbuniat
hpbuniat / xhmem.php
Created May 11, 2012 15:35
Find memory intensive functions in a bunch of xhprof-results (e.g. phpunit run with xhprof-listener)
<?php
class xhparser {
/**
* Content
*
* @var string
*/
private $_aFiles = array();
@hpbuniat
hpbuniat / iframeclick.html
Created May 7, 2012 15:48
Test for tracking clicks within an iframe
<!DOCTYPE html>
<html>
<head>
<meta content="Hans-Peter Buniat" name="author">
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>test iframe clicks</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
var f = {
@hpbuniat
hpbuniat / popunder.html
Created March 17, 2012 12:18
Popunder working in ff 3-12, chrome 10-18, ie6-9 with cookie support
<!DOCTYPE html>
<html>
<head>
<meta content="Hans-Peter Buniat" name="author">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Form-Submit Popunder with Cookie support</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<!-- Cookie support -->
<script type="text/javascript" src="https://cookies.googlecode.com/svn/trunk/jaaulde.cookies.js"></script>
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('max_execution_time', 0);
ini_set('memory_limit', '256M');
/**
* Test for http://instagram-engineering.tumblr.com/post/12651721845/instagram-engineering-challenge-the-unshredder
*
* @author Hans-Peter Buniat
@hpbuniat
hpbuniat / usort.php
Created November 28, 2011 11:53
usort is bad
<?php
$aOpts = getopt('i:');
if (empty($aOpts['i']) === true) {
$aOpts = array(
'i' => 10000
);
}
$aValues = range(0, $aOpts['i'], 1);
shuffle($aValues);
@hpbuniat
hpbuniat / closure-wrapper.php
Last active September 28, 2015 05:18
Simple wrapper for google closure compiler
<?php
/**
* Simple Closure-Compiler Wrapper
* @author Hans-Peter Buniat
*/
class ClosureCompile {
/**
* The Files to work on
*
@hpbuniat
hpbuniat / ParallelTest.php
Created July 6, 2011 12:02
Wrapper for selenium-tests, to execute tests in parallel
<?php
/**
* Wrapper for selenium-tests, to execute tests in parallel
*
* @author Hans-Peter Buniat <hpbuniat@googlemail.com>
* @copyright 2011-2012 Hans-Peter Buniat <hpbuniat@googlemail.com>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*/
class ParallelTests {