Skip to content

Instantly share code, notes, and snippets.

View jasperf's full-sized avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
<script setup>
import AppLayout from '@/Layouts/AppLayout.vue';
import Editor from '@tinymce/tinymce-vue';
import { reactive,onMounted } from 'vue';
import { router } from '@inertiajs/vue3';
import PrimaryButton from '@/Components/PrimaryButton.vue';
// Import TinyMCE
import tinymce from 'tinymce/tinymce';
<div class="bg-white p-4 overflow-hidden shadow-xl sm:rounded-lg">
<editor
:init="{
content_css: false,
skin: false,
content_style: contentUiSkinCss.toString() + '\n' + contentCss.toString(),
height: 500,
menubar: false,
plugins: [
'link', 'lists','image', 'anchor', 'wordcount', 'media'
@jasperf
jasperf / accept-cookies.vue
Created February 6, 2023 06:15
use Vue Cookies to create modal and allow users to accept all or some of the cookies
<template>
<div>
<div v-if="!acceptedCookies">
<p>This website uses cookies for:</p>
<label>
<input type="checkbox" v-model="acceptedAnalyticsCookies">
Analytics
</label>
<label>
<input type="checkbox" v-model="acceptedFunctionalCookies">
@jasperf
jasperf / dreampress.sh
Last active February 3, 2023 01:26
DreamPress WP Rocket AH01075 (503 or 504) Errors as well as Elementor Pro and Sitekit
[Thu Feb 02 17:04:18.993271 2023] [proxy_fcgi:error] [pid 21797:tid 140425448298240] (104)
Connection reset by peer: [client xxx.xxx.xxx.58:0] AH01075:
Error dispatching request to : , referer: https://site.com/wp-admin/options-general.php?page=wprocket
PHP message: PHP Warning: ', referer: https://domain.com/wp-admin/site-health.php
[Thu Feb 02 17:06:08.849910 2023] [proxy_fcgi:error] [pid 21797:tid 140423954396928] [client xxx.xxx.xxx.58:0] AH01071:
Got error ' Undefined array key "analytics" in
/home/wp_xxxxx/domain.com/wp-content/plugins/google-site-kit/includes/Core/Util/Debug_Data.php on line 414
PHP message: PHP Warning: Trying to access array offset on value of type null in
/home/wp_xxxxx/domain.com/wp-content/plugins/google-site-kit/includes/Core/Util/Debug_Data.php on line 414',
referer: https://domain.com/wp-admin/site-health.php
@jasperf
jasperf / color-palette-addition-acf-color-picker.php
Last active January 7, 2023 03:09 — forked from simplethemes/scripts.php
Customize the ACF color picker in your theme and have it load colors of your liking as swatches
<?php
/**
* Add brand color palette to acf color picker
* https://www.advancedcustomfields.com/resources/javascript-api/#filters-color_picker_args
*
*/
function kronos_acf_input_admin_footer() {
?>
<script type="text/javascript">
@jasperf
jasperf / index.html
Created January 3, 2023 01:55 — forked from ypn/index.html
Lazy Loading background images in CSS
<div id="container">
<h3>Lazy loading CSS background images</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam at ligula non lorem facilisis finibus. Suspendisse turpis lacus, tempus sit amet dignissim sit amet, pretium non sem. Ut malesuada purus ac magna placerat, tempus commodo turpis consectetur. Nunc vitae metus vehicula nunc congue varius. Suspendisse egestas urna non finibus feugiat. Vestibulum maximus, nunc et tempus convallis, dui ante vestibulum est, in lobortis purus sapien eget lacus. Suspendisse cursus enim non quam mollis imperdiet. Pellentesque convallis eget nunc vitae fringilla. Fusce interdum, velit semper varius aliquet, eros sapien facilisis erat, iaculis vulputate erat arcu vel neque. Suspendisse dignissim hendrerit lorem. Etiam metus ex, finibus vitae iaculis vitae, iaculis non ex. Phasellus commodo id ante id consequat. Nunc consectetur viverra lacus non fringilla. Pellentesque nec nisl vulputate, sagittis nisl id, venenatis nisi. Nunc malesuada tellus a elit s
<?php
/**
* Add login and logout links to main menu
*
* @param string $items The HTML list content for the menu items.
* @param obj $args An object containing wp_nav_menu() arguments.
*
* @link https://codex.wordpress.org/Function_Reference/wp_login_url
* @link https://codex.wordpress.org/Function_Reference/wp_logout_url
* @link https://developer.wordpress.org/reference/functions/wp_nav_menu/
@jasperf
jasperf / wp-mail-smtp-mailhog-settings.txt
Created October 6, 2022 02:08
Mailhog settings WP Mail SMTP Plugin when running Laravel Valet
smtp port 1025
no encryption
no authentication
host mailhog.test
check mail at http://localhost:8025/
source data https://wpbeaches.com/set-up-smtp-email-for-local-valet-wordpress-development/
<?php
/**
* JSON Handler made by Igor Simic at Coditty with blog post and code at
* https://coditty.com/code/how-to-catch-laravel-exception-and-return-json-response-example
*
*/
namespace App\Exceptions;
use Exception;
@jasperf
jasperf / clear_gravity_form_default_values.js
Created September 25, 2022 08:26 — forked from BronsonQuick/clear_gravity_form_default_values.js
Clear default values in Gravity Forms and place them back in on blur if they are empty
jQuery(document).ready(function($) {
jQuery.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;