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
FROM php:8.0-fpm-buster | |
# Install `docker-php-ext-install` helper to ease installation of PHP | |
# extensions | |
# | |
# Ref: https://github.com/mlocati/docker-php-extension-installer | |
ENV PHP_EXT_INSTALLER_VERSION=1.2.26 | |
RUN set -eux; \ | |
curl --fail -Lo /usr/local/bin/install-php-extensions \ |
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
// in your .env file, split APP_URL to extract protocol and hostname | |
APP_PROTOCOL=https | |
APP_HOSTNAME=myapp.test | |
APP_URL="${APP_PROTOCOL}://${APP_HOSTNAME}" | |
// install dotenv | |
npm install dotenv |
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
function in($needle, ...$haystack): bool | |
{ | |
foreach ($haystack as $hay) { | |
if ((is_array($hay) && in($needle, ...$hay)) || $needle == $hay) { | |
return true; | |
} | |
} | |
return false; | |
} |
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
Route::get('/sign-async-setasign', function () { | |
// Define the path to the OpenSSL executable | |
// $opensslPath = 'C:\\OpenSSL-Win32\\bin\\'; | |
$opensslPath = '/usr/bin/'; | |
// require SetaPDF | |
// require_once 'library/SetaPDF/Autoload.php'; // we are using Composer | |
date_default_timezone_set('Europe/Berlin'); |
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
function phpx { | |
phpPath=/usr/local/etc/php/$PHP_VERSION | |
find $phpPath/php.ini $phpPath/conf.d/*.ini ! -name ext-xdebug.ini | xargs cat > $phpPath/php-no-xdebug.ini | |
php -n -c $phpPath/php-no-xdebug.ini "$@" | |
} |
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
function clone () { | |
[email protected]:$1.git | |
echo "Cloning $REPOSITORY using SSH..." | |
git clone $REPOSITORY $2 2>/dev/null | |
if [[ $? -ne 0 ]] | |
then | |
REPOSITORY=https://github.com/$1.git | |
echo 'Falling back to HTTPS ($REPOSITORY)...' | |
git clone $REPOSITORY $2 |
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
# The path where you usually put your repositories on | |
export MKREPO_REPOSITORIES_BASE_PATH=~/code/ | |
# The path where your initial files (README.md, LICENSE.md and .gitingore) are | |
export MKREPO_SKELETON_PATH=/Users/antoniocarlos/Dropbox/development/.skeleton/ | |
function mkrepo { | |
#/ | |
## Splash | |
#/ |
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
@extends('layouts.app') | |
@section('content') | |
<div class="container-fluid" id="vue-laws"> | |
<div class="row"> | |
<div class="col-md-10 col-md-offset-1"> | |
<div class="panel panel-default"> | |
<div class="panel-heading">Leis</div> | |
<div class="panel-body scrollable"> |
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
// Instead of | |
$instance1 = app($class, $parameters); | |
// or | |
$instance2 = app()->make($class, $parameters); | |
// or |
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 | |
FILENAME="$1" | |
S3_KEY="YOUR-KEY" | |
S3_SECRET="YOUR-SECRET" | |
BUCKET="YOUR-BUCKET" | |
FILEPATH="DESTINATION-DIRECTORY/$file" | |
CONTENT_TYPE="application/octet-stream" | |
DATE_TIME="$(LC_ALL=C date -u +"%a, %d %b %Y %X %z")" | |
MD5="$(openssl md5 -binary < "$FILENAME" | base64)" | |
SIG="$(printf "PUT\n$MD5\n$CONTENT_TYPE\n$DATE_TIME\n/$BUCKET/$FILEPATH" | openssl sha1 -binary -hmac "$S3_SECRET" | base64)" |
NewerOlder