Skip to content

Instantly share code, notes, and snippets.

@Jimmi08
Jimmi08 / functions.php
Created June 12, 2023 07:53 — forked from paulcollett/functions.php
Remove Yoast HTML Comments “This site is optimized with the Yoast WordPress SEO plugin”
// For Yoast SEO Plugin Version: 14.1+ add to your Wordpress Theme's functions.php...
// Remove All Yoast HTML Comments
// https://gist.github.com/paulcollett/4c81c4f6eb85334ba076
// Credit @devendrabhandari (https://gist.github.com/paulcollett/4c81c4f6eb85334ba076#gistcomment-3303423)
add_filter( 'wpseo_debug_markers', '__return_false' );
// For Yoast SEO Plugin Version: < 14.1 add to your Wordpress Theme's functions.php...
@Jimmi08
Jimmi08 / dumprequest.php
Created December 23, 2022 10:21 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
@Jimmi08
Jimmi08 / cf7-get-page-url-of-sender.php
Created November 6, 2022 10:25 — forked from sinebeef/cf7-get-page-url-of-sender.php
Contact Form 7 GET slug/url hidden
//https://wordpress.stackexchange.com/questions/291855/how-to-get-current-url-in-contact-form-7
//You can use cf7 hidden field shortcodes + get parameters: https://contactform7.com/hidden-field/ https://contactform7.com/getting-default-values-from-the-context/
//In the mail form I use such shortcodes to get these slugs
[hidden utm_source default:get]
[hidden utm_medium default:get]
[hidden utm_campaign default:get]
[hidden utm_content default:get]
@Jimmi08
Jimmi08 / wp-disable-plugin-update.php
Created October 23, 2022 06:25 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
@Jimmi08
Jimmi08 / bootstrap-all-elements.html
Created September 13, 2022 10:18 — forked from letanure/bootstrap-all-elements.html
List of all bootstrap components
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap all elements</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
@Jimmi08
Jimmi08 / pagination.php
Created October 29, 2019 11:14 — forked from robmint/pagination.php
Pagination like flickr, digg, github - the standard pagination pattern
<?php
// based on the work of Jason Coleman
// http://www.strangerstudios.com/blog/2006/07/paginate-your-site-like-digg/
/* The pagination function simply spits out a data structure
that you can render any way you like.
See also the javascript version for node:
https://gist.github.com/robmint/4651cf1c6f336e663dba
*/
@Jimmi08
Jimmi08 / regex.php
Created February 19, 2019 21:30 — forked from Moc/regex.php
<?php
$string1 = '<link href="/css/bs4-dynamic-fields-form-2.min.css" rel="stylesheet" media="screen">';
$string2 = '<script src="/cdn-cgi/apps/head/qx0HK83qWJ5I3r2xnETN-ETfo6s.js"></script>"';
$regex1 = '~<link(.*?)href="([^"]+)"(.*?)>~';
$regex2 = '/src=(["\'])(.*?)\1/';
$result1 = preg_match($regex1, $string1, $matches1);
$result2 = preg_match($regex2, $string2, $matches2);
@Jimmi08
Jimmi08 / readme.md
Created November 1, 2018 15:59 — forked from nonsintetic/readme.md
PHP - Get YouTube subscriber count with Youtube API v3

How to:

Here's a 'simple' way to get the YouTube subscriber number from Google's Youtube API v3:

  1. Go to https://console.developers.google.com/apis/library
  2. Log in with your Google account.
  3. Next to the logo click on 'Project' and 'Create project'. Name it whatever you want and click on 'Create'.
  4. Wait until the project is created, the page will switch to it by itself, it will take a couple of seconds up to a minute. Once it's done it will be selected next to the logo.
  5. Once it's created and selected, click on 'Credentials' from the menu on the left.
  6. Click on 'Create Credentials' and choose 'API Key'. You can restrict it to specific IPs, or types of requests (website, android, ios etc.) if you want, it's safer that way.
@Jimmi08
Jimmi08 / .htaccess
Created January 25, 2018 08:19 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/