Skip to content

Instantly share code, notes, and snippets.

@valterlorran
valterlorran / emoji-loader.js
Last active June 8, 2023 12:14
emoji-loader.js without async functions
(function (window, document, settings) {
var src, ii, tests;
let sessionSupports;
let sessionUpdated = false;
const sessionStorageKey = "wpEmojiSettingsSupports";
// Create a promise for DOMContentLoaded since the worker logic may finish after the event has fired.
const domReadyPromise = new Promise(function (resolve) {
document.addEventListener("DOMContentLoaded", resolve, { once: true });
@valterlorran
valterlorran / laravel-passport-create-client-programmatically.php
Created July 2, 2020 03:40
How to creates a laravel passport client programmatically
<?php
// Get the passport client repository
$clientRepository = app('Laravel\Passport\ClientRepository');
// for machine-to-machine authentication
$client = $clientRepository->create(null, 'myclient', '');
// gets the client's id and secret
$clientSecret = $client->secret;
$clientId = $client->id;