Skip to content

Instantly share code, notes, and snippets.

View staabm's full-sized avatar
👋

Markus Staab staabm

👋
View GitHub Profile
@staabm
staabm / jquery.validate.js
Created March 29, 2016 08:21
jq-validate input event
/*!
* jQuery Validation Plugin v1.15.1-pre
*
* http://jqueryvalidation.org/
*
* Copyright (c) 2016 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
Program terminated with signal 11, Segmentation fault.
#0 zend_mm_remove_from_free_list (heap=0x7f22fe23fe30, mm_block=0x7f22fed48448) at /build/php5-0ouR7y/php5-5.4.45/Zend/zend_alloc.c:833
833 /build/php5-0ouR7y/php5-5.4.45/Zend/zend_alloc.c: No such file or directory.
(gdb) bt
#0 zend_mm_remove_from_free_list (heap=0x7f22fe23fe30, mm_block=0x7f22fed48448) at /build/php5-0ouR7y/php5-5.4.45/Zend/zend_alloc.c:833
#1 0x00007f22f9cc8280 in _zend_mm_free_int (heap=0x7f22fe23fe30, p=0x7f22fed48400) at /build/php5-0ouR7y/php5-5.4.45/Zend/zend_alloc.c:2101
#2 0x00007f22f9cfcd1e in zend_hash_destroy (ht=0x7f22fed48260) at /build/php5-0ouR7y/php5-5.4.45/Zend/zend_hash.c:565
#3 0x00007f22f9ced85b in _zval_dtor_func (zvalue=0x7f22fed48230) at /build/php5-0ouR7y/php5-5.4.45/Zend/zend_variables.c:45
#4 0x00007f22f9cdf6ca in _zval_dtor (zvalue=<optimized out>) at /build/php5-0ouR7y/php5-5.4.45/Zend/zend_variables.h:35
#5 _zval_ptr_dtor (zval_ptr=0x7f22fed7ece0) at /build/php5-0ouR7y/php5-5.4.45/Zend/zend_execut
@staabm
staabm / domainlist.php
Last active November 19, 2015 13:47
create a index over all registered vhosts of the local apache2 webserver
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
ul {
float: left;
width: 300px;
margin-top: 10px;
padding-left: 10px;
@staabm
staabm / php.sh
Last active August 29, 2015 14:14
build php branch, incl. phpdbg
#!/bin/bash
if [ "$#" != "1" ]
then
echo "Usage: $0 <branch>"
exit 1;
fi
if [ $1 == "master" ]
then
@staabm
staabm / docker
Last active August 29, 2015 14:14
php-dev docker
#from boot2docker
docker run -it dockerfile/ubuntu
#from withini the new vm
apt-get update && apt-get install -y git gcc bison autoconf libxml2-dev libssl-dev valgrind
mkdir /dvl && cd /dvl
git clone https://github.com/php/php-src.git php/php-src
wget https://gist.githubusercontent.com/staabm/d95a5ee8296043fea30d/raw/112820accbb9f7014814d78868a43cc4782408e4/php.sh && chmod +x php.sh && bash php.sh master
@staabm
staabm / maxpostsize.php
Last active July 30, 2020 14:16
Throw error when post_max_size was reached
<?php
function checkPostSizeExceeded() {
$maxPostSize = iniGetBytes('post_max_size');
if ($_SERVER['CONTENT_LENGTH'] > $maxPostSize) {
throw new Exception(
sprintf('Max post size exceeded! Got %s bytes, but limit is %s bytes.',
$_SERVER['CONTENT_LENGTH'],
$maxPostSize
@staabm
staabm / gist:6be991b7f711a19938cd
Created May 7, 2014 07:36
composer: dump optimized autoload map on dependency install/update
{
...
"scripts": {
"post-update-cmd": [
"composer dump-autoload --optimize"
],
"post-install-cmd": [
"composer dump-autoload --optimize"
]
},
@staabm
staabm / composer.json
Created January 28, 2014 16:38
phpunit on php 5.2
{
"require": {
...
},
"require-dev": {
"pear-phpunit/phpunit": "3.6.*"
},
"repositories": [
{
"type": "pear",
@staabm
staabm / composer.json
Created January 16, 2014 09:11
composer.json for phpunit 3.6 on Ubuntu 10 (requred, because of php 5.2)
{
"require": {
"php": ">=5.2.0",
"staabm/thincache": "0.*",
"rmccue/requests": "1.6.*",
"ircmaxell/password-compat": "1.0.*",
"staabm/xhprof.io": "dev-master"
},
"require-dev": {
"lstrojny/phpunit-clever-and-smart": "dev-master",
@staabm
staabm / callgraph.svg
Created December 30, 2013 12:58
callgraph svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.