Skip to content

Instantly share code, notes, and snippets.

this is how we can use jwt token & jwt token refresh to auth api calls.

  • first we have to use user username which is the default for both packages or it wont work, i couldnt find away to get it to work with email, specialy lexik/jwt-authentication-bundle

  • second we intercept requests to check if the jwt token has expired & if so we recreate new tokens and update request & response headers.

@ctf0
ctf0 / setup xdebug with vscode & docker.md
Last active April 26, 2022 12:13
docker php xdebug setup for vscode (insider)
  1. open terminal and run

    export XDEBUG_CONFIG="idekey=VSCODE"
  2. install xdebug for vscode

  3. add launch config

<?php
namespace App\Http\Middleware\External;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Foundation\Http\Middleware\TransformsRequest;
class CleanEvilInput extends TransformsRequest
{
/**
@ctf0
ctf0 / cron.bat
Last active November 8, 2020 13:38
laravel cron on windows
:loop
php artisan schedule:run 1>> NUL 2>&1
timeout /t 60 /nobreak > NUL
goto loop
<?php
namespace App\Exports;
use Maatwebsite\Excel\Events\AfterSheet;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Events\BeforeExport;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
  • get current theme styles
// https://stackoverflow.com/questions/47117621/how-to-get-the-vscode-theme-color-in-vscode-extensions
const color = new vscode.ThemeColor('badge.background');
  • commands icons can use vscode builtin
"commands": [
    // ... ,
@ctf0
ctf0 / ScrollingLettersAnimation.js
Last active September 10, 2018 21:34
random char
/**
* demo1.js
* http://www.codrops.com
* https://github.com/codrops/ScrollingLettersAnimation
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2018, Codrops
* http://www.codrops.com
<div class="item">ABC</div>
@keyframes spin {
    0% {
        transform: translate(0, 0) scale(1) rotateY(0deg);
    }