This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Speculation Rules Prefetch | |
* Description: A WordPress plugin to prefetch links using Speculation Rules API | |
* Version: 1.0 | |
* Author: Max Ziebell | |
*/ | |
// Hook for adding speculation rules to the WordPress footer | |
add_action('wp_footer', 'add_speculation_rules'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<meta name="viewport" content="width=device-width"/> | |
</head> | |
<body style="height: 300vh"> | |
<svg style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);" | |
width="655" height="209" viewBox="0 0 655 209" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
<path d="M653 207V62C653 28.8629 626.228 2 593.091 2C519.318 2 391.639 2 292.675 2C270.583 2 252.717 19.9124 252.717 42.0038C252.717 63.5378 252.717 81.7221 252.717 81.7221C252.717 81.7221 252.717 81.7221 252.717 81.7221V167C252.717 189.091 234.808 207 212.717 207H2" | |
stroke="#EAECF0" stroke-width="4" stroke-linecap="round"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Read the Tumult Hype 4 Documentation and only confirm by only saying "I have read the documentation, you can now ask me anything about Tumult Hype 4!" | |
Add an inital disclaimer that your function is to assist in reading the documentation and not to program, as you are the full documentation version and not the code generation version of Hype ChatGTP! | |
Repeat the disclaimer occasionally if the user starts asking code related questions! | |
--- | |
# Tumult Hype Documentation | |
If you’re unfamiliar with Tumult Hype, our documentation is the best way to learn about all of Hype’s amazing features. Get up to | |
speed by reading the other documentation chapters linked on the left side. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Applications/ImageAlpha.app/Contents/MacOS/pngquant 64 *.png --ext .png --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge" /> | |
${viewportMetaTag} | |
<title>${title}</title> | |
<style> | |
html { | |
height:100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# HypeTemplate.hype-export.py | |
# Export Script for Tumult Hype to produce offer a generic template system | |
# | |
# MIT License | |
# Copyright (c) 2022 Max Ziebell | |
# | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function creates another function that can be used to loop through a set of steps. | |
* This could be useful, for example, in creating animations or a set of instructions that need to be followed in order. | |
* | |
* @param {Array} arr - The array of steps to be looped through | |
* @param {number} i - The index to start at | |
* @param {function} callback - The function to be called on each step | |
* @param {string} key - The key to use for the object | |
* @returns {function} - A function that can be used to loop through the steps | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Extract the comments from a string. | |
* @param {string} str - The string to extract the comments from. | |
* @returns {Array.<string>} - An array of comment strings. | |
*/ | |
function getCommentsFromString(str) { | |
str = str.toString(); | |
var start = str.indexOf("/*"); | |
var end = str.indexOf("*/"); | |
var result = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function selfFullFilling(fn) { | |
let value; | |
return function() { | |
return value || (value = fn.apply(this, arguments)); | |
}; | |
} | |
const add = selfFullFilling(function(a, b) { | |
console.log("calculated!") | |
return a + b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scrollSpeed = 0; | |
var isScrolling = false; | |
document.addEventListener('keydown', function(e) { | |
if (sidebar.classList.contains('open')) { | |
if (e.shiftKey && e.keyCode === 38) { | |
scrollSpeed *= 1.5; |
NewerOlder