Skip to content

Instantly share code, notes, and snippets.

View Seldaek's full-sized avatar
😀
😀

Jordi Boggiano Seldaek

😀
😀
View GitHub Profile
@Seldaek
Seldaek / gist:6711020
Last active December 23, 2015 23:39
A curious spam comment
km/h55% 0.0mm/ 0.0mm total11:21 25.5C - 15.8C 1006.7hPaNorth 3.5km/h 12.2km/h55%
0.0mm/ 0.0mm total11:26 25.5C - 15.8C 1006.7hPaSE 6.1km/h 12.2km/h55% 0.0mm/
0.0mm total11:31 25.9C - 15.6C 1006.3hPaEast 7.2km/h 8.7km/h53% 0.0mm/ 0.0mm
total11:36 26.0C - 15.7C 1006.7hPaSouth 5.0km/h 8.7km/h53% 0.0mm/ 0.0mm
total11:41 26.1C - 15.5C 1006.3hPaSSW 9.7km/h 9.7km/h52% 0.0mm/ 0.0mm total11:46
26.0C - 15.4C 1006.3hPaSW 5.0km/h 9.7km/h52% 0.0mm/ 0.0mm total11:51 26.4C -
15.8C 1006.3hPaSW 5.0km/h 9.7km/h52% 0.0mm/ 0.0mm total11:56 26.5C - 16.2C
1006.3hPaNW 8.7km/h 8.7km/h53% 0.0mm/ 0.0mm total12:01 26.1C - 15.8C
1006.3hPaSouth 11.1km/h 11.1km/h53% 0.0mm/ 0.0mm total12:06 26.3C - 16.0C
1006.3hPaNW 7.2km/h 11.1km/h53% 0.0mm/ 0.0mm total12:11 26.6C - 16.3C
@Seldaek
Seldaek / results.php
Created April 21, 2016 12:33
PHP Ecosystem Scan
This file has been truncated, but you can view the full file.
<?php return array (
'file' =>
array (
'README' => 71549,
'.gitignore' => 56048,
'LICENSE' => 42975,
'.travis.yml' => 27817,
'phpunit.xml.dist' => 14730,
'phpunit.xml' => 12788,
'composer.lock' => 10886,
PHP 5.5.9 11.87
PHP 7.0.6 10.39
PHP 5.6.20 8.41
PHP 5.6.21 7.69
PHP 5.6.19 4.71
PHP 5.6.5 4.18
PHP 5.5.21 3.64
PHP 7.0.4 3.37
PHP 7.0.5 3.15
PHP 5.4.45 2.96
@Seldaek
Seldaek / foo.php
Created September 30, 2016 08:23
Case-insensitive Classmap
// in POST_AUTOLOAD_DUMP
$map = include('autoload_classmap.php');
// TODO lowercase all keys
file_put_contents('autoload_classmap.php', '<?php return '.var_export($map, 1));
// the above should be done without include ideally to keep the classmap using relative paths,
// but if you don't move the project files around then this is fine.
@Seldaek
Seldaek / bench.php
Created December 8, 2015 10:33
strtr vs str_replace benchmark
<?php
$jobs = array(
'old/strtr' => function($args) {
$classes = [];
foreach ($args as $class) {
$classes[] = strtr($class, '\\', DIRECTORY_SEPARATOR);
}
return $classes;
},

Keybase proof

I hereby claim:

  • I am seldaek on github.
  • I am seldaek (https://keybase.io/seldaek) on keybase.
  • I have a public key whose fingerprint is 96DC 30A1 E352 6046 F9A1 31E9 C435 9456 C838 78B3

To claim this, I am signing this object:

@Seldaek
Seldaek / rant.log
Created April 17, 2015 20:54
freenode/#composer rant
03:54 -!- THEBEEFSTEAK has joined #composer
03:54 <THEBEEFSTEAK> hey guyys
03:54 <THEBEEFSTEAK> RobLoach
03:55 <THEBEEFSTEAK> sandvige
03:55 <THEBEEFSTEAK> scottrigby
03:55 <THEBEEFSTEAK> skoop
03:55 <THEBEEFSTEAK> Spea
03:55 <THEBEEFSTEAK> tonton
03:55 <THEBEEFSTEAK> tystr:
03:55 <THEBEEFSTEAK> s+e:
@Seldaek
Seldaek / potential-squatters.txt
Created June 29, 2016 19:22
Potential Typo-squatters
adam-paterson adampaterson => oauth2-stripe
components component => foundation
#eveseat eve-seat => seat
#frozzare frozzere => wp-admin-menu-tabs
guzzlehttp puzzlehttp => streams
gwis gws => php-valueobjects
ite ice => form-bundle
kcs ucs => utils
laravel larvel => framework
mindy hindy => application, base, cache, console, controller, di, event, exception, helper, http, locale, logger, middleware, orm, query, router, security, session, tests, utils, validation
@Seldaek
Seldaek / ext-requires.txt
Last active February 15, 2020 18:52
PHP Extension Requirements on Packagist.org
Taken from packagist.org
Packages with a master branch update since June 1st 2018: 98977
Of those, package having requires on PHP extensions: 11676 (11.79%)
As only ~12% of packages declare their extension requirements,
and even then it might not be a complete list, take all this with
a big grain of salt, it is informative but definitely not a
complete picture of the most used extensions.
@Seldaek
Seldaek / Authenticator.php
Created November 20, 2012 11:19
Simple Symfony Auth example
<?php
namespace Acme\DemoBundle\Security;
use Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\HttpFoundation\Request;