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
import gulp from 'gulp'; | |
import webpack from 'webpack'; | |
import loader from 'gulp-load-plugins'; | |
const plugins = loader(); | |
// Basic path and environment configuration | |
const config = { | |
dirs: { | |
assets: './app/Resources/assets', | |
build: './web/build', |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
.image-container { | |
/** | |
* For this trick to work, you need to have some sort | |
* of size set to the container element. | |
*/ |
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
var http = require('http'); | |
var app = function (req, res) { | |
res.writeHead(200, { | |
'Content-Type': 'application/text' | |
}); | |
res.end('Hello World'); | |
}; | |
var server = http.createServer(app); |
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
git diff --name-only --cached --diff-filter=ACMRTUXB | while read filename; do | |
php-cs-fixer fix $filename | |
git add $filename | |
done |
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
export MYSQL_ROOT_PASSWORD="root-password" | |
export MYSQL_DATABASE="database-name" | |
export MYSQL_USER="username" | |
export MYSQL_PASSWORD="user-password" | |
docker run --name mysql \ | |
-p 3306:3306 \ | |
-e MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD \ | |
-e MYSQL_DATABASE=$MYSQL_DATABASE \ | |
-e MYSQL_USER=$MYSQL_USERNAME \ |
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 | |
try { | |
$result = $service->getVerificationResult($value); | |
} catch (VerificationException $exception) { | |
// ... | |
return; | |
} | |
if (!$result->isVerified()) { | |
foreach ($result->getErrors() as $error) { |
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 | |
/** | |
* @throws VerificationException | |
*/ | |
function getVerificationResult($value): VerificationResult | |
{ | |
// ... | |
} |
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 | |
/** | |
* @throws UserNotFoundException | |
* @throws InsufficientPermissionsException | |
* @throws ConnectionFailedException | |
*/ | |
function publish(Post $post): void | |
{ | |
// This may throw a UserNotFoundException |
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 | |
interface UserExceptionInterface extends Throwable | |
{ | |
} | |
class UserCannotPublishPostException extends Exception implements UserExceptionInterface | |
{ | |
} |
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 VerificationService | |
{ | |
/** | |
* @throw VerificationException | |
*/ | |
public function getVerificationResult($value): VerificationResult | |
{ | |
try { |
OlderNewer