Creating a new PHPExcel Object.
$this->PHPExcel = new PHPExcel();
Creating a new sheet:
// Länder sollen Vertikal von A-Z anstatt Horizontal sortiert werden | |
function sort_market_verticaly($markets, $marketColumns = 5) { | |
$countMarkets = count($markets); | |
$numMarketsPerBlock = intval($countMarkets / $marketColumns); | |
$leftOver = $countMarkets % $marketColumns; | |
$newSortMarkets = array(); | |
for ($i = 0, $marketCount = 0; $i < $marketColumns && $marketCount < $countMarkets; $i++) { | |
for ($j = 0; $j < $numMarketsPerBlock; $j++) { | |
$newSortMarkets[$i][] = $markets[$marketCount]; |
<?php | |
/** | |
* Recursively converts nested array into a flat one with keys preserving. | |
* @param array $result Resulting array | |
* @param array $array Source array | |
* @param string $prefix Key's prefix | |
* @param string $connector Levels connector | |
*/ | |
function flatArray(array &$result, array $array, $prefix = null, $connector = '.') { | |
foreach ($array as $key => $value) { |
#!/bin/bash | |
IPT="/sbin/iptables" | |
# Server IP | |
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')" | |
# Your DNS servers you use: cat /etc/resolv.conf | |
DNS_SERVER="8.8.4.4 8.8.8.8" | |
# Allow connections to this package servers |
<?php | |
class A | |
{ | |
private $ab = 5; | |
public $ac = 6; | |
} | |
/** | |
* WARNING: This https://bugs.php.net/bug.php?id=45937 seems not yet solved |
Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.
The following steps assume you've got a set-up like mine, where:
# IPv6 | |
## | |
## set default policies to let everything in | |
ip6tables --policy INPUT ACCEPT; | |
ip6tables --policy OUTPUT ACCEPT; | |
ip6tables --policy FORWARD ACCEPT; | |
## | |
## start fresh |
rsync (Everyone seems to like -z, but it is much slower for me)
<?php | |
/* Found at http://stackoverflow.com/questions/1057572/how-can-i-get-a-hex-dump-of-a-string-in-php */ | |
function hex_dump($data, $newline="\n") | |
{ | |
static $from = ''; | |
static $to = ''; | |
static $width = 16; # number of bytes per line |