https://chat.openai.com/?model=gpt-4-browsing
You:
Please tell me about yourself, and your capabilities.
ChatGPT:
https://chat.openai.com/?model=gpt-4-browsing
You:
Please tell me about yourself, and your capabilities.
ChatGPT:
| <?php | |
| /** | |
| * Inpspired by Scott Jehl: https://www.filamentgroup.com/lab/load-css-simpler/ | |
| * | |
| **/ | |
| add_action( 'style_loader_tag', 'async_preload_stylesheets', 99, 4 ); | |
| function async_preload_stylesheets( string $tag, string $handle, string $href, string $media ) : string { | |
| // Add the stylesheet handles you want to load async | |
| $allowlist = [ 'your-stylesheet-handle' ]; |
Some questions about frontend development that might be in your next job interview. The questions were formulated by @mauvieira, a super senior fullstack developer
What are the strategies we can use to optimize the performance of web applications?
What are Web Vitals (LCP, FID, CLS)? And how are they applied in the real world?
| <?php | |
| /** | |
| * Optimize Loading Separate Core Block Assets in Classic Themes Plugin. | |
| * | |
| * @package OptimizeLoadingSeparateCoreBlockAssetsInClassicThemes | |
| * @author Weston Ruter | |
| * @link https://gist.github.com/westonruter/25187db63a7666f08b151ca53497ffb5 | |
| * @license GPL-2.0-or-later | |
| * @copyright 2023 Google Inc. | |
| * |
| <?php | |
| /** | |
| * Plugin Name: Elementor Activation | |
| * Description: Activates Elementor Pro - Not everybody have shell acces to run WP CLI or desire for eveybody to see license key. Manual activation is needed, and since Elementor wont add this, community will :) | |
| * Plugin URI: https://github.com/elementor/elementor/issues/8667 | |
| * Gist Plugin URI: https://gist.github.com/lupetalo/38e6d40b620b7da976c42c2d207c674a | |
| * Version: 1.3 | |
| */ | |
| add_filter('pre_http_request', function($request, $request_params, $url){ | |
| if (strpos($url, 'my.elementor.com/api/v2/license/')!==false){ |
| ############ Config to harden Nginx running Wordpress sites | |
| # Paste this in a new file like: /etc/nginx/conf.wp/harden-wordpress.conf | |
| # in main/vhost config add: include /etc/nginx/conf.wp/harden-wordpress.conf; | |
| # | |
| # Restart nginx and voila. This gist is based on: | |
| # https://gist.github.com/nfsarmento/57db5abba08b315b67f174cd178bea88 | |
| # | |
| ############ WordPress #################### | |
| # Disable logging for favicon and robots.txt |
| // Get the UTM parameters from the URL | |
| var search = window.location.search; | |
| var params = new URLSearchParams(search); | |
| // Keep track of if an event has already been logged | |
| var eventLogged = false; | |
| // Loop through each UTM parameter | |
| for (var [key, value] of params.entries()) { | |
| // Check if the parameter is "utm_source", "utm_medium", "utm_campaign", "utm_term", or "utm_content" |
| <?php | |
| $req_url = "https://api.openat.com/v1/engines/audio-transcribe-801/transcriptions"; | |
| $openai_key = getenv("OPENAI_API_KEY"); | |
| $file_path = "test.mp3"; | |
| $file = file_get_contents($file_path); | |
| $form_fields = array( | |
| 'file' => array($file_path, $file, 'audio/mpeg') | |
| ); | |
| <?php | |
| add_filter( 'wpseo_schema_webpage', 'change_schema_ref', 11, 2 ); | |
| function change_schema_ref( $piece ) { | |
| $linkstring ='https://www.agespace.org'.$_SERVER['REQUEST_URI']; | |
| $piece['@id']=$linkstring; |
| var trackClickEvent = function () { | |
| var eventCategory = this.getAttribute("data-event-category") || "unknown"; | |
| var eventLabel = this.getAttribute("data-event-label") || ""; | |
| gtag('event', eventCategory, { 'label' : eventLabel, 'debug_mode': true }); | |
| }; | |
| var elementsToTrack = document.getElementsByClassName("ga-event"); |