Skip to content

Instantly share code, notes, and snippets.

View lrtrln's full-sized avatar

LRTRLN lrtrln

View GitHub Profile
@lrtrln
lrtrln / index.html
Created January 29, 2016 14:45
vEvGxe
<div class="flexbox">
<!-- card list -->
<ul class="flex-card-list">
<!-- card list item -->
<li class="flex-card-listitem">
<!-- card module -->
<div class="flex-card">
<!-- image container -->
<div class="flex-card-image">
<img src="http://placehold.it/300x200&text=%20" />
@lrtrln
lrtrln / wp_term.sql
Last active March 1, 2017 15:02
Wordpress : list all terms from a taxonomy
SELECT t.name, t.term_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id
WHERE tt.taxonomy IN ('tax')
ORDER BY t.name ASC LIMIT 0 , 500
GTmetrix Test Server Locations
from https://gtmetrix.com/locations.html
208.70.247.157
204.187.14.70
204.187.14.71
204.187.14.72
204.187.14.73
204.187.14.74
204.187.14.75
@lrtrln
lrtrln / gist:6c34253360441f895abdac31edf30c1d
Last active May 22, 2020 16:16
Shell auto-completion script for themes and plugins list for wp-cli subcommands
_wp_complete() {
local cur=${COMP_WORDS[COMP_CWORD]}
local command=${COMP_WORDS[1]}
local subcommand=${COMP_WORDS[2]}
COMPREPLY=""
if [[ "$command" = "plugin" ]]
then
case "$subcommand" in
@lrtrln
lrtrln / gist:1288eeb64b9c0556459ccf1b0ed277d8
Last active August 12, 2020 13:00
Remove Users and Tax from the Sitemap XML feature in WordPress 5.5
add_filter(
'wp_sitemaps_add_provider',
function($provider, $name) {
if ('users' === $name OR 'taxonomies' == $name) {
return false;
}
return $provider;
}, 10, 2
);
@lrtrln
lrtrln / gist:1a0d96e317c3322a53eacf569fb01612
Last active March 28, 2024 12:58
HTTP header save-data
<?php
function getHttpRequestHeaders()
{
$headers = [];
foreach ($_SERVER as $key => $value) {
if (substr($key, 0, 5) === 'HTTP_') {
$headerKey = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($key, 5)))));
$headers[$headerKey] = $value;
}
}