Skip to content

Instantly share code, notes, and snippets.

@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);
    }
@ctf0
ctf0 / -laravel tips.md
Last active October 21, 2023 05:41
laravel tips
  • php assoc array to correct js array of objs
$data = [
    'Users' => 'abc',
    'posts' => 'blabla',
];

collect($data)->map(function ($v, $k) {
 return [