Skip to content

Instantly share code, notes, and snippets.

@rubo77
rubo77 / gist:6815165
Last active December 24, 2015 14:49 — forked from joshbmarshall/gist:6517321
The original Ghist didn't sent the correct result if an empty string is sent to the function. My edit sends an empty array as the original parse_str
<?php
/**
* do the same than parse_str without max_input_vars limitation
* @param $string array string to parse
* @return array query parsed
**/
function my_parse_str($string) {
if($string==='') return array();
$result = array();
@rubo77
rubo77 / circumvent_max_input_vars.php
Last active December 24, 2015 14:49
This Demo script is a javascript solution to circumvent the max_input_vars limit of PHP for http://stackoverflow.com/a/19107646/1069083
<html><head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<title>circumvent max_input_vars limit in PHP</title></head>
<body>
<a href="circumvent_max_input_vars.php">restart</a><br>
<?php
/**
* do the same than parse_str without max_input_vars limitation:
* Parses $string as if it were the query string passed via a URL and sets variables in the current scope.
@rubo77
rubo77 / my_parse_str.php
Last active May 7, 2021 11:14 — forked from Shagshag/gist:5849065
This is a replacement for the original idea how to cirumvent the max_input_vars limitation, that uses the original parse_str() on each element of the query to parse
<?php
/**
* do the same than parse_str without max_input_vars limitation:
* Parses $string as if it were the query string passed via a URL and sets variables in the current scope.
* @param $string array string to parse (not altered like in the original parse_str(), use the second parameter!)
* @param $result array If the second parameter is present, variables are stored in this variable as array elements
* @return bool true or false if $string is an empty string
*
@rubo77
rubo77 / gist:7003745
Last active December 25, 2015 16:09
adding up- and downarrows in table headers with CSS :after
table {
border-collapse: collapse;
border-spacing: 0;
}
table th.header {
background-color: #F3F781;
padding-right: 0px;
cursor:pointer;
}
CREATE TABLE action_recorder (
id int NOT NULL auto_increment,
module varchar(255) NOT NULL,
user_id int ,
user_name varchar(255),
identifier varchar(255) NOT NULL,
success char (1),
date_added datetime NOT NULL,
PRIMARY KEY (id),
KEY idx_action_recorder_module (module),
@rubo77
rubo77 / upgrade oscommerce database from v2.2 to v2.3
Last active December 27, 2015 13:09
needed changes to upgrade oscommerce database from v2.2 to v2.3
-- needed changes to upgrade oscommerce database from v2.2 to v2.3:
-- missing keys:
-- ALTER TABLE `$table` ADD $indextype ( `$field` )
-- orders_products :
-- KEY idx_orders_products_orders_id (orders_id)
ALTER TABLE orders_products ADD INDEX (orders_id);
-- KEY idx_orders_products_products_id (products_id)
ALTER TABLE orders_products ADD INDEX (products_id);
@rubo77
rubo77 / gist:7331266
Created November 6, 2013 05:14
oscommerce 2.3 enhancements
alter table configuration modify description text NOT NULL;
alter table configuration modify configuration_key varchar(255) NOT NULL;
alter table categories modify categories_name varchar(255) NOT NULL;
@rubo77
rubo77 / cron_traffic.php
Created December 6, 2013 09:42
/var/www/syscp/scripts/cron_traffic.php
<?php
/**
* This file is part of the SysCP project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
*
# this doesn't work yet:
cd /var/tmp/
git clone https://github.com/pfps/yoga-laptop.git
cd yoga-laptop/yoga_laptop/
make
sudo make install
sudo udevadm hwdb --update
mv ~/.Xmodmap ~/.Xmodmap.bak
cp -pr xkeycode ~/.Xmodmap
reboot
Dist: dapper
Name: Dapper Drake
Version: 6.06 LTS
Date: Thu, 01 Jun 2006 9:00:00 UTC
Supported: 0
Description: This is the Dapper Drake release
Release-File: http://archive.ubuntu.com/ubuntu/dists/dapper/Release
ReleaseNotes: http://changelogs.ubuntu.com/EOLReleaseAnnouncement
UpgradeTool: http://archive.ubuntu.com/ubuntu/dists/dapper/main/dist-upgrader-all/current/dapper.tar.gz
UpgradeToolSignature: http://archive.ubuntu.com/ubuntu/dists/dapper/main/dist-upgrader-all/current/dapper.tar.gz.gpg