Skip to content

Instantly share code, notes, and snippets.

@odan
odan / nginx-php-windows-setup.md
Last active September 22, 2023 08:29
Nginx and PHP Setup on Windows
View nginx-php-windows-setup.md
@odan
odan / unbloat.bat
Last active July 31, 2023 15:22
Remove Windows Bloatware
View unbloat.bat
@echo off
winget list
winget uninstall "Solitaire & Casual Games"
winget uninstall "Microsoft Kontakte"
winget uninstall "Movies & TV"
winget uninstall "News"
winget uninstall "Get Help"
winget uninstall "Microsoft People"
@odan
odan / mocking-interface-phpunit.md
Last active March 29, 2023 12:32
Mocking Interfaces with PHPUnit
View mocking-interface-phpunit.md
View ExcelFileReader.php
<?php
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
/**
* ExcelFileReader.
*/
class ExcelFileReader
{
View strip-html.md

Remove HTML tags

<?php

$html = '<div class="cc">
    Explore the use of simple 
    <a class="keyword_w_elaboration">technologies</a>
    <div class="elaboration" style="text-decoration:none">
 
@odan
odan / remove-namespaces-xml.php
Last active March 25, 2023 11:26
Remove all namespaces from XML in PHP (dirty hack)
View remove-namespaces-xml.php
<?php
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$dom->loadXML(file_get_contents(__DIR__ . '/demo.xml'));
$dom = removeAllNamespaces($dom);
$dom->save('demo-out.xml');
@odan
odan / splitting-pdf.md
Last active March 25, 2023 11:26
Spliting a PDF file into multiple PDF files
View splitting-pdf.md