Skip to content

Instantly share code, notes, and snippets.

Example usage

php equation-resolver.php

Output:

(1 / 7 + 7) * (7 + 7) = 100
((1 / 7) + 7) * (7 + 7) = 100
(7 + 1 / 7) * (7 + 7) = 100
@bnf
bnf / Fedora systemd-nspawn container for web development.md
Last active November 24, 2023 16:12
Fedora systemd-nspawn container for web development

Fedora systemd-nspawn container for web development

Requires: systemd/systemd#30080

Usage

cd path/to/your/local/sources
# creates a container with the current directory mapped to /var/www/html and configures apache/php/mariadb.
create-webfedora.sh testsite
@bnf
bnf / .git_hooks_pre-push
Last active January 16, 2024 13:11
Prevent accidental push of security commits
#!/usr/bin/bash
# Store in .git/hooks/pre-push
# Only allow pushes of branches named "security*" and
# commits that include "SECURITY" to the remote
# named $ALLOWED_SECURITY_REMOTE
ALLOWED_SECURITY_REMOTE="security"
@bnf
bnf / typo3-default-configuration-to-json-schema.php
Last active March 25, 2024 07:36
TYPO3 Default Configuration Description to JSON Schema Converter
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
$fileName = 'typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml';
$data = Yaml::parseFile($fileName);
$defaultConfiguration = require('typo3/sysext/core/Configuration/DefaultConfiguration.php');
$schema = (new SchemaConverter())->parseSchema(
@bnf
bnf / typo3-default-configuration-to-settings.php
Created March 27, 2024 10:43
TYPO3 DefaultConfigurationDescription.yaml to Settings.schema.yaml
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
$fileName = 'typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml';
$data = Yaml::parseFile($fileName);
$defaultConfiguration = require('typo3/sysext/core/Configuration/DefaultConfiguration.php');
$schema = new stdClass;