Skip to content

Instantly share code, notes, and snippets.

@iksent
iksent / Confirm.php
Created August 13, 2020 11:10
Directus Public User Registration (+ Email Confirmation!)
<?php
require_once __DIR__ . '/SignupConfig.php';
use Directus\Application\Application;
use Directus\Application\Http\Request;
use Directus\Application\Http\Response;
use Directus\Authentication\Exception\ExpiredRequestTokenException;
use Directus\Authentication\Exception\InvalidTokenException;
use Directus\Util\JWTUtils;
@elalemanyo
elalemanyo / README.md
Last active April 23, 2024 18:25
Debug zsh startup time

Debug zsh startup time

  1. Inject profiling code

    At the beginning of your .zshrc add following: zmodload zsh/zprof

    and at the end add: zprof

    This will load zprof mod and display what your shell was doing durung your initialization.

@rpflamm
rpflamm / Controller.php
Created April 20, 2018 13:48
File Upload with TYPO3 8.7.13
<?php
namespace Vendor\MyExt\Controller;
class MyController extends ActionController
{
/**
* action create
*
* @param \Vendor\MyExt\Domain\Model\MyModel $myModel
@carcinocron
carcinocron / debugger pause beforeunload
Last active April 25, 2024 16:48
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@xperseguers
xperseguers / controller.php
Last active April 4, 2023 07:56
Upload files in TYPO3 from Frontend
/**
* Upload files.
*
* @return void
*/
public function uploadAction() {
$overwriteExistingFiles = TRUE;
$data = array();
$namespace = key($_FILES);