Skip to content

Instantly share code, notes, and snippets.

View rmpel's full-sized avatar

Remon Pel rmpel

View GitHub Profile
@rmpel
rmpel / wp_rewrite_rules.log
Created January 4, 2022 09:53 — forked from thenbrent/wp_rewrite_rules.log
Default WordPress Rewrite Rules
[rules] => Array (
[category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
[category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]
[category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2]
[category/(.+?)/?$] => index.php?category_name=$matches[1]
[tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]
[tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]
[tag/([^/]+)/page/?([0-9]{1,})/?$] => index.php?tag=$matches[1]&paged=$matches[2]
[tag/([^/]+)/?$] => index.php?tag=$matches[1]
[type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2]
@rmpel
rmpel / pfx-to-crt-and-key.sh
Created March 5, 2018 14:28 — forked from whereisaaron/pfx-to-crt-and-key.sh
Extract a crt file (PEM), key file, and chain bundle from a PFX file, prompts for password or use PFXPASSWORD environment variable
#!/bin/bash
#------------------
# Extract the key, certficiate, and chain in PEM format from a PFX format file
#
# Must supply the input pfx file
PFX_PATH="$1"
if [ "${PFX_PATH}" == "" ]; then
echo "Must supply pfx file path"
exit 1
@rmpel
rmpel / multilingual-search-slug-with-wpml.php
Last active July 7, 2022 10:09
WPML Multilingual Search slug
<?php
/*-----------------------------------------
REWRITE SEARCH URLS
-----------------------------------------*/
// Redirect ?s=xxx to /search/xxx
function redirect_search_url()
{
if (is_search() && !empty($_GET['s'])) {
wp_redirect(home_url('/' . _x('search' /* default search slug */, 'search url slug', THEME_TEXT_DOMAIN) . '/') . urlencode(get_query_var('s')));
@rmpel
rmpel / gist:3c882d59a28570b10df9fe0ee2f72dac
Last active September 6, 2016 11:46 — forked from padolsey/gist:527683
IE Version Detect
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}