Skip to content

Instantly share code, notes, and snippets.

View sstok's full-sized avatar
🎯
Focusing

Sebastiaan Stok sstok

🎯
Focusing
View GitHub Profile
@sstok
sstok / app.php
Created December 27, 2016 15:19 — forked from wouterj/app.php
<?php
namespace App;
require __DIR__.'/vendor/autoload.php';
use Symfony\Component\Console\Application;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Input\InputArgument;
@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 September 24, 2024 14:44
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 );