Skip to content

Instantly share code, notes, and snippets.

View drupol's full-sized avatar

Pol Dellaiera drupol

View GitHub Profile
@drupol
drupol / .block
Last active July 27, 2017 11:42
Hilbert curve
license: gpl-3.0

Keybase proof

I hereby claim:

  • I am drupol on github.
  • I am poldellaiera (https://keybase.io/poldellaiera) on keybase.
  • I have a public key ASB7pOkMHfoK_ZG9iDDpkbmAoD9N3G1lJqgJruj93a3Crgo

To claim this, I am signing this object:

@drupol
drupol / e.php
Last active August 15, 2017 11:19
Approximate numbers e and pi using combinatorics and Fibonacci.
<?php
/**
* Find the number e (2.7182818284590452354 => M_E constant in PHP).
*
* To find the number e using permutations:
* 1: Generate a set of size S of random values,
* 2: Find the number of permutations of that set, let it be #P0,
* 3: With all the permutations of this set, let #P1 the count of the permutations where
* any items are not at the same index as in the original input,
* 4: Divide #P0 by #P1, that's your approximation,
@drupol
drupol / data.json
Last active January 2, 2018 19:21
SNCB/NMBS: Stations and Lines
This file has been truncated, but you can view the full file.
[{"id":"BE.NMBS.007015400","locationX":"-0.1260606","locationY":"51.5310399","@id":"http://irail.be/stations/NMBS/007015400","standardname":"London Saint Pancras International","name":"London Saint Pancras International","wikidata":{},"adjacents":[],"connecting_lines":[]},{"id":"BE.NMBS.007015440","locationX":"0.32107","locationY":"51.44304","@id":"http://irail.be/stations/NMBS/007015440","standardname":"Ebbsfleet International","name":"Ebbsfleet International","wikidata":{},"adjacents":[],"connecting_lines":[]},{"id":"BE.NMBS.008008094","locationX":"6.795297","locationY":"51.219178","@id":"http://irail.be/stations/NMBS/008008094","standardname":"Duesseldorf Hbf","name":"Duesseldorf Hbf","wikidata":{},"adjacents":[],"connecting_lines":[]},{"id":"BE.NMBS.008010053","locationX":"7.459293","locationY":"51.517898","@id":"http://irail.be/stations/NMBS/008010053","standardname":"Dortmund Hbf","name":"Dortmund Hbf","wikidata":{},"adjacents":[],"connecting_lines":[]},{"id":"BE.NMBS.008010184","locationX":"7.014427185
@drupol
drupol / .block
Last active January 5, 2018 22:43
Belgian railway stations
license: gpl-3.0
@drupol
drupol / .block
Last active January 9, 2018 10:15
London tube - stations and lines graph
license: gpl-3.0
@drupol
drupol / .block
Last active January 24, 2018 21:41
Lorenz attractors
license: gpl-3.0
### Keybase proof
I hereby claim:
* I am drupol on github.
* I am poldellaiera (https://keybase.io/poldellaiera) on keybase.
* I have a public key ASD7NjxxB0Y_sANjg-o1OoKlSpUBN4KGtbRa-wSZDt3EpQo
To claim this, I am signing this object:
@drupol
drupol / collatz.php
Created September 14, 2019 16:46
Collatz conjecture's sequence of numbers
<?php
declare(strict_types=1);
include 'vendor/autoload.php';
use drupol\collection\Collection;
// The Collatz conjecture (https://en.wikipedia.org/wiki/Collatz_conjecture)
$collatz = static function (int $initial = 1): int
@drupol
drupol / composer.php
Last active December 16, 2019 11:52
Composer dependency tree with PHPTree
<?php
declare(strict_types=1);
use drupol\launcher\Launcher;
use drupol\phptree\Exporter\Image;
use drupol\phptree\Importer\SimpleArray;
include './vendor/autoload.php';