Skip to content

Instantly share code, notes, and snippets.

@chavesm
chavesm / remove_type_attr_1148073.php
Last active June 29, 2021 11:42
Remove unnecessary "type" attribute from MI script code to keep HTML validators happy. Second file adds async attribute to external gtag script.
<?php // Ignore this line if copying to child theme's functions.php
/** Remove the unnecessary "type" attribute from MI script code by leaving it out of the filter. */
function remove_type_attr_1148073() {
return array(
'data-cfasync' => 'false' // Ask CloudFlare Rocket Loader not to execute.
);
}
add_filter( 'monsterinsights_tracking_analytics_script_attributes', 'remove_type_attr_1148073' );
@jjcodes78
jjcodes78 / mysql-sail.md
Last active May 2, 2025 14:41
Laravel Sail - GRANT ALL PRIVILEGES to user

Run this command in sail project folder:

docker-compose exec mysql bash

execute the mysql -u root -p command

provide the default password password

then executes

@cryptoskillz
cryptoskillz / gist:98b8e7090b7cc8d51531bb9dcfe7654a
Created December 5, 2021 16:48
Tips on how to use a KV namespace with Cloudflare Pages
This gist aims to show you how to use KV datastore using Cloudflare pages. The reason I created this quick guide is it took
me almost 2 weeks to get it working, mainly because it is very new and the documentation is not up fully fleshed out yet
https://developers.cloudflare.com/workers/runtime-apis/kv
https://developers.cloudflare.com/pages/platform/functions
https://blog.cloudflare.com/wrangler-v2-beta/
Steps:
Install wrangler 2