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
# Using node | |
node -e 'require("crypto").randomBytes(48, (e, b) => console.log(b.toString("hex")))' |
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
# Install Gatsby starter w/ TypeScript support | |
gatsby new project-name https://github.com/jpedroschmitz/gatsby-starter-ts | |
# Install Tailwind | |
npm install -D gatsby-plugin-postcss tailwindcss@latest postcss@latest autoprefixer@latest && npx tailwindcss init -p | |
# Update gatsby-config.js to include: | |
# plugins: ['gatsby-plugin-postcss'], | |
# Create global.css: |
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 | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
use Ramsey\Uuid\Uuid; | |
class AlterFailedJobsAddUuid extends Migration | |
{ | |
public function up() |
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 Controllers; | |
class FilesController | |
{ | |
/** | |
* Add a route definition: | |
* $router->get("assets/{any}", "FilesController@index")->where('any', '.*'); | |
*/ |
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
{ | |
"data": { | |
"id": 546395, | |
"completed_at": "2021-08-13 03:30:38" | |
}, | |
"timestamp": 1628825438, | |
"environment": "develop", | |
"type": "orders.completed", | |
"webhook_version": "1" | |
} |
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
{ | |
"data": { | |
"id": 461606, | |
"email": "james_smith@fakedomain.org", | |
"phone_number": "+1122334455", | |
"creation_channel": "customer_service" | |
}, | |
"timestamp": 1628825494, | |
"environment": "develop", | |
"type": "customers.registered", |
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; | |
use Illuminate\Http\Request; | |
class HmacVerifier | |
{ | |
public function isValid(Request $request, string $secret): bool | |
{ |
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 | |
/** | |
* In routes/api.php | |
*/ | |
$router->get('api/v2/users', 'UsersController@index'); | |
/** |
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 | |
use Carbon\Carbon; | |
use Illuminate\Support\Arr; | |
if (!function_exists('version')) { | |
/** | |
* Attempts to determine the current version of the application, based on `version` set in config/app.php and either | |
* the file public/version.html (which should be created during the build process) or by exec'ing Git commands directly | |
* at runtime. This results in a string of the format `<app-version>-<hash> (<last-modified>)` |
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); | |
use Lcobucci\JWT\Signer\Ecdsa\Sha256; | |
use Lcobucci\JWT\Signer\Key\InMemory; | |
use Lcobucci\JWT\Encoding\UnixTimestampDates; | |
use Lcobucci\JWT\Decoder; | |
use Lcobucci\JWT\Encoder; | |
use Lcobucci\JWT\Encoding\CannotDecodeContent; |