This file contains hidden or 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
/*====== RANDOM NUMBER BETWEEN TWO GIVEN VALUES ======= */ | |
const randomInt = (min, max) => | |
Math.floor(Math.random() * (max - min) + 1) + min; | |
/*====== DATE DIFF ======= */ | |
const formatMovementDate = function (date, locale) { | |
const calcDaysPassed = (date1, date2) => | |
Math.round(Math.abs(date2 - date1) / (1000 * 60 * 60 * 24)); |
This file contains hidden or 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 | |
namespace App\EventSubscriber; | |
use ApiPlatform\Core\EventListener\EventPriorities; | |
use App\Entity\Property; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; | |
use Symfony\Component\HttpKernel\KernelEvents; |
This file contains hidden or 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 | |
namespace App\Entity; | |
use ApiPlatform\Core\Annotation\ApiResource; | |
use ApiPlatform\Core\Annotation\ApiSubresource; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; | |
use Doctrine\ORM\Mapping as ORM; | |
use Gedmo\Timestampable\Traits\TimestampableEntity; |
This file contains hidden or 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
puts "What's your first name?" | |
first_name = gets.chomp | |
puts "What's your last name?" | |
last_name = gets.chomp | |
full_name = "#{first_name} #{last_name}" | |
puts "Your full name is #{full_name}." | |
puts "Your full name reversed is " + full_name.reverse | |
puts "Your name has " + full_name.length + " characters in it" |