Skip to content

Instantly share code, notes, and snippets.


Julian Pustkuchen JPustkuchen

View GitHub Profile
JPustkuchen / getMinMaxFromMediaQuery.php
Last active Feb 12, 2018
PHP regex extraxt min-width / max-width from CSS MediaQuery
View getMinMaxFromMediaQuery.php
function getMinMaxFromMediaQuery($mediaQuery) {
$re = '/\d*(min-width|max-width):\s*(\d+\s?)(px|em|rem)/';
preg_match_all($re, $mediaQuery, $matches, PREG_SET_ORDER, 0);
$result = array();
if (!empty($matches)) {
if (count($matches) <= 2) {
foreach ($matches as $match) {
if (count($match) == 4) {
$result[] = [
JPustkuchen /
Last active Jan 9, 2018
[Docker set default binding IP e.g. for links in portainer] #docker

cd /etc/default/docker (if not existing, create the file)

Add the following line (or the --ip=... part if already existing):

DOCKER_OPTS="--ip=" (Your docker host IP)

Restart docker: systemctl stop docker