This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// tests/App/ReflectionTrait.php | |
namespace App\Tests; | |
trait ReflectionTrait | |
{ | |
/** | |
* @param $object | |
* @param $methodName | |
* @param array $parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="row"> | |
<div class="col-md-6 col-sm-6 col-xs-12"> | |
<div class="info-box"> | |
<span class="info-box-icon bg-green"><i class="fa fa-users"/></span> | |
<div class="info-box-content"> | |
<span class="info-box-text">Active users</span> | |
<span class="info-box-number">{{ usersCount || 0 }}</span> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User implements UserInterface, \Serializable | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function serialize(): string | |
{ | |
return serialize([$this->id, $this->username, $this->password]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
namespace App\CSV; | |
use League\Csv\Reader; | |
use League\Csv\Statement; | |
use voku\helper\UTF8; | |
class CsvReader | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Faker\Provider; | |
use libphonenumber\NumberParseException; | |
use libphonenumber\PhoneNumber; | |
use libphonenumber\PhoneNumberUtil; | |
use libphonenumber\PhoneNumberFormat; | |
class PhoneNumberProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# escape the slash in document root | |
DOCUMENT_ROOT=\/var\/www\/html\/ | |
SYMFONY_ENV=dev | |
# The full path is written by the Twig compiler, generally at the end of the cache file in the getSourceContext() method | |
grep -RhoP "${DOCUMENT_ROOT}.*\.html\.twig" app/cache/${SYMFONY_ENV}/twig/ | grep -v vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Migrations; | |
use Doctrine\DBAL\Migrations\AbstractMigration; | |
use Doctrine\DBAL\Schema\Schema; | |
class Version00000000000000 extends AbstractMigration | |
{ | |
public function up(Schema $schema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
root /var/www/example.com/web; | |
index index.php; | |
server_name example.com.dev; | |
access_log /var/log/nginx/$host.access.log; | |
error_log /var/log/nginx/$host.error.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$zip = new ZipArchive(); | |
$t = $zip->open('MA.20130715-174538.ZIP'); | |
$fp = $zip->getStream('MA.XML'); | |
while (!feof($fp)) { | |
echo fread($fp, 4096); | |
} | |
fclose($fp); | |
$zip->close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source http://stackoverflow.com/questions/5870188/does-flask-support-regular-expressions-in-its-url-routing | |
from flask import Flask | |
from werkzeug.routing import BaseConverter | |
app = Flask(__name__) | |
class RegexConverter(BaseConverter): | |
def __init__(self, url_map, *items): | |
super(RegexConverter, self).__init__(url_map) | |
self.regex = items[0] |
NewerOlder