Skip to content

Instantly share code, notes, and snippets.

View vanaf1979's full-sized avatar

VA79 vanaf1979

View GitHub Profile
@vanaf1979
vanaf1979 / gmip-cf.php
Last active March 6, 2024 09:41
Wordpress shortcode and tags/functions to deal with cloudflare returned country codes
<?php
/**
* GMIP
*
* @package GMIP
* @author Stephan Nijman
* @copyright 2024 Granmedia
* @license GPL-2.0-or-later
* @version 1.0.0
*
<!doctype html>
<html lang="en">
<head>
<!-- This is your document head.-->
<!-- It is not visible to the user, but it contains information for the browser,-->
<!-- like the title, seo meta tags and stylesheet links.-->
<!-- Docs; https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head -->
<title>Document</title>
</head>
<body>
// Name: shoes
import "@johnlindquist/kit";
let Jimp = await npm("jimp")
let text = await editor(`
## Enter a url per line
## Hit cmd+s to "continue"
@vanaf1979
vanaf1979 / RenderedBlocks.php
Created March 24, 2021 08:29
Are blocks rendered yet
<?php
final class RenderedBlocks {
/**
* instance.
*
* @var RenderedBlocks $instance class instance.
*/
private static $instance = null;
<div class="box"></div>
<button id="addClass">Add active class</button>
<button id="removeClass">Remove active class</button>
<button id="toggleClass">Toggle active class</button>
<div class="box"></div>
<button id="addClass">Add active class</button>
<button id="removeClass">Remove active class</button>
<div class="box"></div>
<button id="addClass">Add active class</button>
console.log( element.className );
element.classList.contains("classname");
const box = document.querySelector(".box");
const toggleButton = document.querySelector('#toggleClass');
toggleButton.addEventListener('click', () => {
box.classList.toggle("active");
});