Skip to content

Instantly share code, notes, and snippets.

@odan
odan / soap-xmldsig.md
Created Jun 1, 2021
Sign SOAP messages with xmlseclibs
View soap-xmldsig.md

Sign SOAP messages with xmlseclibs

Requirements

  • PHP 7.4+
  • OpenSSL

Generating Public and Private Keys

First we have to create a private key for signature creation, and a public key for verification.

@odan
odan / nginx-php-windows-setup.md
Last active Jul 8, 2022
Nginx and PHP Setup on Windows
View nginx-php-windows-setup.md

Nginx and PHP Setup on Windows

For local development you could also use Nginx with PHP as an replacement for XAMPP.

Install Nginx

View _slim-diagnostic.md

Slim 4 - Server Setup Diagnostic

The url has changed:

@odan
odan / httpd-xampp.conf
Created Dec 5, 2020
XAMPP with PHP 8 - Apache settings
View httpd-xampp.conf
#
# XAMPP settings
#
<IfModule env_module>
SetEnv MIBDIRS "/xampp/php/extras/mibs"
SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
SetEnv OPENSSL_CONF "/xampp/apache/bin/openssl.cnf"
SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php"
SetEnv PHPRC "\\xampp\\php"
@odan
odan / readme.md
Created Dec 3, 2020
Slim 4 - Creating ZIP files in memory
View readme.md

Creating ZIP files in memory

composer require maennchen/zipstream-php --ignore-platform-reqs
    $options = new \ZipStream\Option\Archive();

 // Disable output of HTTP headers
@odan
odan / mysq_uuid_v4.md
Last active Feb 16, 2022
Generating UUID v4 in MySQL
View mysq_uuid_v4.md

Generating UUID v4 in MySQL

SELECT
  LOWER(
    CONCAT(
      # 1th and 2nd block are made of 6 random bytes
      HEX(RANDOM_BYTES(4)),
      '-',
 HEX(RANDOM_BYTES(2)),
View User Authentication System.md

User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

View slim4-oauth2-jwt.md
View TypeInspector.php
<?php
namespace App\Utility;
use DomainException;
use ReflectionClass;
/**
* Type inspector.
*/
@odan
odan / Slim 4 Tutorial.md
Last active Jan 15, 2022
Slim 4 Tutorial
View Slim 4 Tutorial.md