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 BlaBlaBla extends Migration | |
{ | |
// ... up, down whatever | |
protected function existsForeignKey($table, $foreignKey) | |
{ | |
$sql = "SELECT KEY_COLUMN_USAGE.CONSTRAINT_NAME | |
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE | |
WHERE KEY_COLUMN_USAGE.TABLE_NAME = '{$table}' AND KEY_COLUMN_USAGE.COLUMN_NAME = '{$foreignKey}'"; |
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\Application\Http; | |
use Psr\Http\Message\ResponseInterface as Response; | |
use Psr\Http\Message\ServerRequestInterface as Request; | |
use Psr\Log\LoggerInterface; | |
use Slim\Exception\HttpBadRequestException; |
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 Xpto | |
{ | |
public function addPoints($amount) | |
{ | |
return $this->processPoints($amount, function ($amount, $currentPointsAvailable, $conversionRate) { | |
return $currentPointsAvailable + ($amount * $conversionRate) | |
}); | |
} |
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 XDEBUG_REMOTE_HOST=$(ifconfig wlp6s0 | grep -oE 'inet [[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' | cut -c6-) |
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
#!/usr/bin/make | |
include .env | |
export | |
.PHONY: help | |
.DEFAULT_GOAL := help | |
help: ## Display this help | |
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) |
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 | |
if [[ ! -d /var/www/app/node_modules ]]; then | |
echo "~> installing dependencies" | |
yarn install | |
fi | |
if [[ ! -f /home/node/bin/node && -f /usr/local/bin/node ]]; then | |
echo "~> expose bin" | |
cp /usr/local/bin/node /home/node/bin/node |
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\Domain\Admin; | |
use App\Infrastructure\Entity\AbstractEntity; | |
/** | |
* Class Profile |
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\Http\Response; | |
use App\Http\Status; | |
use Illuminate\Http\JsonResponse; | |
use Illuminate\Support\Facades\Response; | |
/** | |
* Class Answer |
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\Exceptions; | |
use App\Http\Response\AnswerTrait; | |
use App\Http\Status; | |
use Exception; | |
use ForceUTF8\Encoding; | |
use Illuminate\Database\QueryException; | |
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; |
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
# configure grep regEx to your ifcongig output | |
export XDEBUG_REMOTE_HOST=$(ifconfig wlp6s0 | grep -oE 'inet [[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' | cut -c6-) |