AbstractSanitizer.php
<?php
abstract class AbstractSanitizer
{
protected $sanitizers = [];
public function sanitize($data)
{
#!/usr/bin/env python | |
def matrix(n, i): | |
assert i < n | |
for j in range(n): | |
yield j + 1 + (i * n) | |
n = 10000 | |
search_n = 50000 |
<?php | |
use Illuminate\Support\Collection; | |
abstract class AbstractEloquent implements BaseRepositoryInterface | |
{ | |
/** | |
* Model repository. | |
*/ | |
protected $resource; |
AbstractSanitizer.php
<?php
abstract class AbstractSanitizer
{
protected $sanitizers = [];
public function sanitize($data)
{
<?php | |
$env = $app->detectEnvironment(function () { | |
$env_files = glob(__DIR__ . '/../.env.*.php'); | |
if (count($env_files)) { | |
list($env) = sscanf(basename(current($env_files)), '.env.%[^.].php'); | |
return $env; | |
} |
<?php | |
/* | |
* HOW TO TEST: | |
* composer require illuminate/support nestbot/carbon fzaninotto/faker | |
*/ | |
require 'vendor/autoload.php'; | |
date_default_timezone_set('America/Sao_Paulo'); | |
header('Content-Type: text/plain'); |
<?php | |
/** | |
* Laravel trait to allow aliasing table fields. | |
* | |
* @author Paulo Freitas <me@paulofreitas.me> | |
*/ | |
namespace App; |
<?php | |
use Carbon\Carbon; | |
class DateUtils extends Carbon | |
{ | |
public function isSameWeek(Carbon $dt) | |
{ | |
return $this->weekOfYear === $dt->weekOfYear; | |
} |
<?php | |
/* Transpose Macro */ | |
Collection::macro('transpose', function () { | |
$items = array_map(function (...$items) { | |
return $items; | |
}, ...$this->values()); | |
return new static($items); | |
}); |
<?php | |
class GeoJSON | |
{ | |
public function __construct(string $geojson) | |
{ | |
$this->_struct = json_decode($geojson); | |
} | |
public static function fromString(string $geojson) |
Bugs/issues reported, pull requests contributed and stuff like that, pushed here and there.
72 contributions so far: