Skip to content

Instantly share code, notes, and snippets.

Avatar

Julian Pustkuchen JPustkuchen

View GitHub Profile
@JPustkuchen
JPustkuchen / getMinMaxFromMediaQuery.php
Last active Feb 12, 2018
PHP regex extraxt min-width / max-width from CSS MediaQuery
View getMinMaxFromMediaQuery.php
<?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
JPustkuchen / README.md
Last active Jan 9, 2018
[Docker set default binding IP e.g. for links in portainer] #docker
View README.md

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

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

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

Restart docker: systemctl stop docker