Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Blog del Corso</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="https://unpkg.com/awsm.css/dist/awsm.min.css" />
</head>
<body>
<header>
<h1>
/@0-mail\.com$/
/@0815\.ru$/
/@0815\.su$/
/@0clickemail\.com$/
/@0wnd\.net$/
/@0wnd\.org$/
/@10minutemail\.co\.za$/
/@10minutemail\.com$/
/@10minutemail\.de$/
/@123-m\.com$/
@EmanueleMinotto
EmanueleMinotto / -proof-of-concept
Last active December 16, 2015 14:38
PoC directory
/
Acme
Package
Library.php
LibraryTest.php
composer.json
.gitignore
.gitattributes
acmescript
// Solves the intersection for a single component
// Reference: http://stackoverflow.com/questions/2821506/how-do-you-tell-if-two-wildcards-overlap
function innersect(w1, w2) {
// both are either empty or contain a wildcard
if ((w1 === "" || w1 === "*") &&
(w2 === "" || w2 === "*")) return true;
// only one of them is empty, the other is not just a wildcard
if (w1 === "" || w2 === "") return false;
var c1 = w1[0], c2 = w2[0];
var remain1 = w1.slice(1), remain2 = w2.slice(1);
ema:cli ema$ phpunit
PHPUnit 4.8.8 by Sebastian Bergmann and contributors.
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 63 / 227 ( 27%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 126 / 227 ( 55%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 189 / 227 ( 83%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.
Time: 1.94 seconds, Memory: 35.25Mb
<?php
// File: app/config/importer.php
use Symfony\Component\Finder\Finder;
$finder = new Finder();
$files = $finder->files()->name('*.yml')->in(__DIR__.'/services')->in(__DIR__.'/vendors');
foreach ($files as $file) {
$loader->import($file->getRealpath());
}
@EmanueleMinotto
EmanueleMinotto / README.md
Created January 29, 2015 21:01
PHP Profiler

Profiler

This is a simple PHP profiler based on syslog and ticks.

Killer feature is that it doesn't need to be included inside statements but only prepend your scripts.

@EmanueleMinotto
EmanueleMinotto / README.md
Created January 29, 2015 21:00
PHP Exceptions Handlers

Exceptions Handlers

Starting from an idea of @lastguest, I'm writing this code to allow a chain of handlers.

What's the problem? Main problem is that more than one exception handlers aren't allowed so easily.

@EmanueleMinotto
EmanueleMinotto / README.md
Created January 29, 2015 20:59
PHP Microframework

Microframework

This is a PHP (5.3+) microframework based on anonymous functions.

Features

  • requested URLs matched using regular expressions
  • request methods (matches using regular expressions too)
  • differenced FIFO queues for each $priority
  • command line usage
  • backward compatibility
  • integrated Dependency Injection and settings system
  • named patterns
@EmanueleMinotto
EmanueleMinotto / README.md
Created January 29, 2015 20:57
PHP Configuration

Configuration

This configuration system is based on default runtime configuration system.

Difference consists in SAPI access: PHP alone supports .user.ini files only using CGI/FastCGI SAPI, using this version custom configurations can be setted outside main php.ini.