Skip to content

Instantly share code, notes, and snippets.

View beto-aveiga's full-sized avatar
💭
Testing, testing, testing...

Beto Aveiga beto-aveiga

💭
Testing, testing, testing...
View GitHub Profile
@slivorezka
slivorezka / get_entity_by_alias.php
Created March 29, 2017 18:26
Drupal 8: Get Entity By Alias
<?php
// Some entity alias (node, taxonomy_term, user, etc).
$alias = '/about';
// Get URL obj.
$url = Url::fromUri('internal:' . $alias);
// Check exist alias.
if ($url->isRouted()) {
$params = $url->getRouteParameters();
$entity_type = key($params);
// GEt entity.
@devjin0617
devjin0617 / .manifest
Created May 19, 2017 15:15
chrome extension using a content script to access the `window` object
{
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["inject.js"],
"all_frames": true
}
],
"web_accessible_resources": [
"content.js"

Occasionally when accessing a client network, I encounter a situation where certain servers are not accessible. Despite everyone else on the team being able to access the same domain, either by HTTP or SSH. It turns out a frequent culprit of this problem is Docker and it's networking mechanisms.

When you start up Docker, it appropriates some IP addresses for it's own usage. These are usually in the local networking space, which include the following:

  • 10.0.0.0 to 10.255.255.255
  • 172.16.0.0 to 172.31.255.255
  • 192.168.0.0 to 192.168.255.255

Discovering Conflicts