Skip to content

Instantly share code, notes, and snippets.

View joelharkes's full-sized avatar

Joël Harkes joelharkes

  • Frontify
  • Biel/Bienne Switzerland
View GitHub Profile
@joelharkes
joelharkes / install.bash
Last active November 6, 2024 11:07
Install Minecraft java edition on windows
# For my kids and future setup
winget install Oracle.JavaRuntimeEnvironment
winget install Mojang.MinecraftLauncher
# If you want to build any mods in the future
# winget search java
winget install Oracle.JDK.23
@joelharkes
joelharkes / file.php
Created February 5, 2025 13:47
Turn in memory PHP JSON like value into nikic/PHP-Parser statements
<?php
class ValueToStatement
public function valueToStatement(mixed $value): Node\Expr
{
return match (gettype($value)) {
'boolean' => new Node\Expr\ConstFetch(new Node\Name($value ? 'true' : 'false')),
'integer' => new Node\Scalar\Int_($value),
'double' => new Node\Scalar\Float_($value),
'string' => new Node\Scalar\String_($value),
'array' => new Node\Expr\Array_(