Skip to content

Instantly share code, notes, and snippets.

View sstok's full-sized avatar
🤒
Out sick

Sebastiaan Stok sstok

🤒
Out sick
View GitHub Profile
@sstok
sstok / DiffObjectCollections.php
Last active October 30, 2023 20:07
Domain helper stuff
<?php
use Assert\Assertion;
trait DiffObjectCollections
{
/**
* @var object[]
*/
protected $items;
@sstok
sstok / (SQL) Injected
Last active March 20, 2024 12:55
parody-programming-songs 💩
Patient Zero - Infected - Hammer Fall
=====================================
I code alone, my screen begins to peel
Forsaken in my misery to battle this "OR" deal
I can't resist the cravings,
no I have to ease the pain
My screaming brain is melting slowly,
turning me insane
@sstok
sstok / ShortArraySyntaxFixer.php
Last active August 29, 2015 14:03
ShortArraySyntaxFixer for PHP-CS-Fixer
use Symfony\CS\FixerInterface;
use Symfony\CS\Tokens;
class ShortArraySyntaxFixer implements FixerInterface
{
public function fix(\SplFileInfo $file, $content)
{
$tokens = Tokens::fromCode($content);
for ($index = 0, $c = $tokens->count(); $index < $c; $index++) {
<?php
function trimURL( $psInput )
{
if ( mb_strlen( $psInput ) < 39 )
{
return $psInput ;
}
$aURL = @ parse_url( $psInput );