This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Edge | |
{ | |
public function __construct(public readonly Verticle $linkedFrom, public readonly Verticle $linkedTo) | |
{ | |
} | |
} | |
class Verticle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TreeNode | |
{ | |
public function __construct(public readonly string $value, public readonly ?TreeNode $left = null, public readonly ?TreeNode $right = null) | |
{ | |
} | |
public function makeRightAsTreeNodeThenDo(TreeNode $right, callable $result): void | |
{ | |
$result(new self($this->value, $this->left, $right)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array = ['H', 'E', 'L', 'L', 'O', 1.1]; | |
$stackLifo = new ArrayIterator(['D', 'L', 'R', 'O', 'W']); | |
$stackLifoAsArray = $stackLifo->getArrayCopy(); | |
// Add left to the stack (the last added, will be the first out) | |
array_push($stackLifoAsArray, ' '); | |
array_push($stackLifoAsArray, 'Hello'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Node | |
{ | |
private ?Node $next; | |
public function __construct(public readonly string $value) | |
{ | |
$this->next = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables. | |
What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding. | |
Network configuration | |
Here’s how it’s done: | |
Create a virtual interface that serves as the gateway for your VMs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"root": true, | |
"extends": [ | |
"eslint:recommended", | |
"plugin:@typescript-eslint/eslint-recommended", | |
"plugin:@typescript-eslint/recommended" | |
], | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { "project": ["./tsconfig.json"] }, | |
"plugins": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Liste des domaines | |
# | |
#----------------------------------------------------------------- | |
if [ "$(groups $USER | grep staff)" == "" ] || [ "$(groups $USER | grep sudo)" == "" ]; then | |
echo "Vous ne faites pas partie du staff ou vous n'êtes pas sudoer !" | |
exit 1 | |
fi | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/tmp/sh | |
echo "Content repository of" `whoami` | |
# ou echo "Contenu du répertoire de" $(whoami) | |
ls -a /home/user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import abc | |
from typing import Callable, IO, cast | |
from east_displayer import Output, OutputStream | |
from east_typer import StringComputer, String, StringReceiver, ReceiverOfString | |
class MessageTemplating(metaclass=abc.ABCMeta): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import abc | |
import sys | |
import json, base64 | |
from typing import Callable, IO, cast | |
import requests | |
import pandas as pd | |
import attr |
NewerOlder