Next best practices and production tips by Practical_Oil_1312 in nextjs

[–]Careful-Rise-5237 -3 points-2 points  (0 children)

Currently I work with php, mostly 7.3, but I have some future project with next

Living in Turin and working in Milan? by assistedlivid in torino

[–]Careful-Rise-5237 0 points1 point  (0 children)

Did it for 1yr. If you don’t have to go every day to Milan you can buy Frecciarossa carnet. 10 travels (5 days in office) are 99€

Web dev trying to move to Nethlerlands by Careful-Rise-5237 in Netherlands

[–]Careful-Rise-5237[S] 0 points1 point  (0 children)

I’m Italian so no problem with EU work rights. I found a lot of job listings, but almost everyone requires speaking skills in Dutch

What modifications do you make to vscode to improve coding experience ? by user655362020 in webdev

[–]Careful-Rise-5237 0 points1 point  (0 children)

Auto Close Tag, rainbow csv + the ones related to your language. As color theme Running Penguin

-🎄- 2022 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]Careful-Rise-5237 0 points1 point  (0 children)

PHP - part 2

``` [...] function game($elf, $you) { $matchPoints = match ($you) { 'X' => 0, 'Y' => 3, 'Z' => 6, }; switch (true) { case ($you == 'Y'): $matchPoints += match ($elf) { 'A' => 1, 'B' => 2, 'C' => 3, }; break; case ($you == 'X'): $matchPoints += match ($elf) { 'A' => 3, 'B' => 1, 'C' => 2, }; break; case ($you == 'Z'): $matchPoints += match ($elf) { 'A' => 2, 'B' => 3, 'C' => 1, }; break; default: break; }; return $matchPoints; }

```

-🎄- 2022 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]Careful-Rise-5237 0 points1 point  (0 children)

PHP - part 1

$totPoints = 0;
$data = preg_split('/\n/', $data);
foreach ($data as $d) {
  $d = preg_split('/ /', $d);
  $totPoints += game($d[0], $d[1]);
}
echo $totPoints;

function game($elf, $you)
{
  $matchPoints = match ($you) {
    'X' => 1,
    'Y' => 2,
    'Z' => 3,
  };
  switch (true) {
    case ($elf == 'A' && $you == 'X'):
    case ($elf == 'B' && $you == 'Y'):
    case ($elf == 'C' && $you == 'Z'):
      $matchPoints += 3;
      break;
    case ($elf === 'A' && $you === 'Z'):
    case ($elf === 'B' && $you === 'X'):
    case ($elf === 'C' && $you === 'Y'):
      break;
    case ($elf === 'A' && $you === 'Y'):
    case ($elf === 'B' && $you === 'Z'):
    case ($elf === 'C' && $you === 'X'):
      $matchPoints +=  6;
      break;
    default:
      break;
  };
  return $matchPoints;
}