Skip to content

Instantly share code, notes, and snippets.

@tpavlek
tpavlek / combinations.php
Created June 2, 2016 22:12
Get all combinations of two collections
<?php
/**
* If you have two sets of collections, which you would previously have used a nested foreach to do something to each unique
* combination of items, you can use this macro to get it done instead!
*
* It will return a collection of tuples that represent the combination of the two collections. If you'd like to add keys to the tuple
* you can pass that in as an optional second argument!
*/
@tronsha
tronsha / installphp7.sh
Last active October 13, 2023 00:13
Install PHP7 to Ubuntu
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
apt-get update
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make
mkdir -p /etc/php7/conf.d
mkdir -p /etc/php7/cli/conf.d
mkdir /usr/local/php7