public class Hello
{
public static void Main()
{
- System.Console.WriteLine("Hello, World!");
+ System.Console.WriteLine("Rock all night long!");
}
}
<?php | |
$query = <<<'GRAPHQL' | |
query GetUser($user: String!) { | |
user (login: $user) { | |
name | |
repositoriesContributedTo { | |
totalCount | |
} |
On M1 machines, Docker for Mac is running a lightweight linux ARM VM, then running containers within that, so containers are essentially running natively. Don't be fooled by the fact the UI or binary CLI tools (e.g. docker
) might require Rosetta.
Within that VM is an emulation layer called QEmu. This can be used by docker to run Intel containers. This does not use Rosetta at all, and has a roughly 5-6X performance penalty. (If you just upgraded your CPU this may result in a similar performance to your old machine!)
Many images in public registries are multi-architecture. For instance at the time of writing on Docker Hub the php:8.0-cli
image has the following digests:
<?php | |
declare(strict_types=1); | |
namespace App\Doctrine\EventListener; | |
use Doctrine\DBAL\Schema\PostgreSQLSchemaManager; | |
use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs; | |
final class FixPostgreSQLDefaultSchemaListener |
I use PlantUML a lot. It's what I use for drawing all sorts of diagrams and it's handy because of its easy markup (once you get used to it) while making things easy to maintain as projects grow (thanks to version control)
This gist explains how I do my PlantUML workspace in a project.
- The idea is to keep a
globals
directory for all diagrams to follow (like the "stylesheet" below) to keep things consistent. - I use a
stylesheet.iuml
file that keeps the use of colors consistent through use of basic FOREGROUND, BACKGROUND and ACCENT colors. - The
style-presets.iuml
file defines these colors so you can make "presets" or "themes" out of them. - As stated in the
stylesheet.iuml
, you'll need the Roboto Condensed and Inconsolata fonts for these to work properly. - You can choose to either run the PlantUML jar over your file/s, or use an IDE like VSCode with the PlantUML extension. Here's a preview of
example-sequence.puml
for example: https://imgur.com/Klk3w2F
I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:
- the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
- set the service for
oauth_user_provider
in thesecurity.yml
with your custom created service
Here are the steps:
- Routing. In
routing.yml
I have added all the routes for both bundles. - Configuration. I have set the
config.yml
mostly as it is presented in the HWIOAuthBundle. - Security. I have set the
security.yml
mostly as it is presented in the HWIOAuthBundle (though my routes are using/login
pattern, not/connect
). Also, theoauth_user_provider
is set for my custom service.
<?php | |
declare(strict_types=1); | |
use PHPUnit\Framework\Assert; | |
use PHPUnit\Framework\Constraint\Callback; | |
use PHPUnit\Framework\Constraint\Constraint; | |
/** | |
* This is a replacement for InvocationMocker::withConsecutive() which is |
<?php | |
namespace Zalas\Infrastructure\Scraper; | |
use OldSound\RabbitMqBundle\RabbitMq\Consumer; | |
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface; | |
use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface; | |
use PhpAmqpLib\Connection\AbstractConnection; | |
use PhpAmqpLib\Connection\AMQPLazyConnection; | |
use PhpAmqpLib\Exception\AMQPTimeoutException; |
#!/bin/bash | |
# | |
# /etc/kernel/postinst.d script to sign akmods kmods after kernel upgrade | |
# | |
# Author: Michael Goodwin Date: 2016-09-21 | |
# 1. Copy this script to /etc/kernel/postinst.d/ and `chmod +x` it | |
# | |
# 2. Create signing keys (store these somewhere useful and safe): | |
# $ mkdir -p /etc/pki/tls/private/mok |