Skip to content

Instantly share code, notes, and snippets.

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

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

  3. add launch config

View CleanEvilInput.php
<?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 Nov 8, 2020
laravel cron on windows
View cron.bat
:loop
php artisan schedule:run 1>> NUL 2>&1
timeout /t 60 /nobreak > NUL
goto loop
View laravel excel sheet formating.php
<?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;
View laravel auto resolve polymorphic many to many.md
View _vscode custom styleing.md
  • add the files in that order
"vscode_custom_css.imports": [
    "file:///path/to/vars.css",
    "file:///path/to/defaults.css",
    "file:///path/to/theme-stuff.css",
    "file:///path/to/tabs-curve.css", // or normal
    "file:///path/to/tabs-single.css"
],
View -vscode tips.md
  • 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": [
 // ... ,
View ScrollingLettersAnimation.js
/**
* 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