Getting EC2 instance tags from the inside of a running instance
Getting informations on a running instance from the inside is a tedious task and it’s usually done in an insecure and error prone way. With this article we want to…
Getting informations on a running instance from the inside is a tedious task and it’s usually done in an insecure and error prone way. With this article we want to…
What this code does?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
class DateTimeInterval { private $from; private $to; private $allDayLong; public function setFrom(\DateTime $from) { if ($this->isAllDayLong()) { $from->setTime(0, 0, 0); } $this->from = $from; return $this; } public function getFrom() { ... } // omitted public function setTo(\DateTime $to) { if ($this->isAllDayLong()) { $to->setTime(23, 59, 59); } $this->to = $to; return $this; } public function getTo() { ... } // omitted public function allDayLong() { $this->allDayLong = true; } public function isAllDayLong() { return $this->allDayLong; } } |
It’s a simple class that represent a DateTimeInterval with a flag named allDayLong that let an object of DateTimeInterval class to fill all day. You can see that…
It’s said necessity is the mother of invention and in this article we’ll show the reason why we initially wrote s3-pit-restore. Our infrastructure heavily rely on S3 object storage to…
Sometimes happens, as it happened to us, that you have one or more services you want to share between your VPCs. For us, the case was for an ELK stack…
If you know PHPSpec a bit, you certainly are aware of let function.
1 2 3 4 |
function let(EntityManager $em) { $this->beConstructedWith($em); } |
that helps you to define “automagic” mocks handled directly by PHPSpec and that you can pass to…
AWS is well known for its cloud services for almost everything you need in a cloud environment. As Madisoft we like them a lot and we use many of them…
Good news mates: we were selected as speakers for Symfony Day 2016 (Italy) that will take place in Rome (tickets available here). Samuele and Matteo sent out their talk proposals and both were…
We were looking for a way to have our EC2 EBS volumes snapshotted on a daily basis. We already use AWS and Ansible, so the solution comes quite straightforward: Ansible +…
Sessions are one of the main building blocks of a login-based web application. We’re going to see what they are, what Symfony offers us to handle them and how to scale when…
This weekend I was poking into my first PHPSpec tests and I found a real scenario that, I bet, you faced at least once if you do BDD/TDD and so…
Today we are going to analyze a very common situation if you use Symfony framework: let’s talk about collection of objects, forms used to handle them and “collection swapping” (a.k.a.…
Reading the countless articles concerning Javascript and specifically ES7, I noticed complete and utter confusion about introduced features. Any new feature introduced after ES6 is tagged as a feature that will be introduced in…