Skip to content

Instantly share code, notes, and snippets.

View juanwilde's full-sized avatar

Juan González juanwilde

View GitHub Profile
<?php
public function execute(): void
{
$this->logger->info(sprintf('Providers: %s', iterator_count($this->providers)));
foreach ($this->providers as $provider) {
try {
$events = iterator_to_array($provider->fetchEvents());
$this->processBatch($events);
} catch (Throwable $e) {
// EventImport
<?php
declare(strict_types=1);
namespace App\Application\UseCase;
use App\Application\Service\EventProviderInterface;
use App\Domain\Repository\EventRepository;
use Psr\Log\LoggerInterface;
{
"version": "2.0.0",
"tasks": [
{
"label": "TypeScript: Watch",
"type": "shell",
"command": "npx tsc --noEmit --watch",
"options": {
"cwd": "${workspaceFolder}/api"
},
server {
listen 443 ssl;
server_name api.server.com;
ssl_certificate /etc/ssl/cloudflare/api.pem;
ssl_certificate_key /etc/ssl/cloudflare/key.key;
client_max_body_size 20M;
location / {
// Coupled to framework (a service knowing about the implementation of the data layer)
class OrderService
{
public function getOrders(): iterable
{
return Order::all();
}
}
// Not coupled to framework
[supervisord]
user=root
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/var/run/supervisord.pid
loglevel = INFO
[unix_http_server]
file=/var/run/supervisor.sock
name: Tests
on:
pull_request:
branches: [ main ]
jobs:
build:
name: Run tests
runs-on: ubuntu-latest
public function __invoke(User $user): void
{
if (!$user instanceof UserInterface) {
return;
}
// some great stuff here
}
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Nest Framework",
@juanwilde
juanwilde / .htaccess
Created August 31, 2016 12:38
htaccess Codeigniter 3
Options FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>