Skip to content

Instantly share code, notes, and snippets.

Dom dompl

  • Red Frog Studio
  • United Kingdom
Block or report user

Report or block dompl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dompl
dompl / .htaccess
Created Oct 17, 2018 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#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/
@dompl
dompl / Cache.php
Created Oct 1, 2018 — forked from monkeymonk/Cache.php
Wordpress Transient Helper Class
View Cache.php
<?php
/**
* Helpers to work with Wordpress transient API
*
* @example
* $foo = Cache::get('foo', function () {
* // query DB or other complicated stuff...
* return $results;
* }, 24 * 60 * 60);
View gma-body
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
View gist:8f395c88b0882b5b91c486e15de51a5e
table tr th {
background: #222;
color: #fff;
padding: 0;
border: #111 solid 1px;
text-align: center;
font-weight: bold;
}
table tr td {
border: 1px #ccc solid;
View tracking.js
<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19018051-1']);
_gaq.push(['_setCustomVar', 1, 'Page creation time and ram', '599', 3]);
_gaq.push(['_setCustomVar', 2, 'Logged-in user', 'anonymous', 3]);
_gaq.push(['_trackPageview']);
_gaq.push (['_gat._anonymizeIp']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
View bash.generate.random.alphanumeric.string.sh
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
View gist:67b4b6f25a3c754448690067a7f6ac3b
/*
JQuery Inline Popup
https://github.com/Position2/jQuery-Inline-Popup
*/
(function($) {
var defaults = { "itemSelector" : "",
"ipclass" : "inlinepopup",
"ipcloseclass" : "inlinepopupClose",
"iparrowclass" : "inlinepopup_arrow",
"ipcontentwrapperclass" : "inlinepopup_content",
@dompl
dompl / WordPress Transients - Helper Class.php
Created Mar 11, 2018 — forked from elhardoum/WordPress Transients - Helper Class.php
WordPress Transients - Helper Class - for handling WordPress Transients and caching data and keeping things simple as they should
View WordPress Transients - Helper Class.php
<?php
/**
* WordPress Transients - Helper Class
*
* Makes it easier to store transients and call them and all in like 4 lines of code
* Helps you save large amounts of data (arrays) without the confusing proccess of
* chunking data into batches, and joining later upon getting all the data and also
* deleting all of these batches correctly. This class does it all for you.
*
@dompl
dompl / woo-get-list-of-countries-wuth-continents.php
Created Dec 4, 2017
WooCommerce - Get list of countries with continent names.
View woo-get-list-of-countries-wuth-continents.php
<?php
function a3435_get_list_of_countries()
{
$get_countries = new WC_Countries();
$r = '
<table>
<tr>
@dompl
dompl / woo-custom-product-ordering.php
Created Dec 2, 2017
Additional custom product ordering
View woo-custom-product-ordering.php
<?php
add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args');
add_filter('woocommerce_default_catalog_orderby_options', 'custom_woocommerce_catalog_orderby');
add_filter('woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby');
function custom_woocommerce_get_catalog_ordering_args($args)
{
$orderby_value = isset($_GET['orderby']) ? woocommerce_clean($_GET['orderby']) : apply_filters('woocommerce_default_catalog_orderby', get_option('woocommerce_default_catalog_orderby'));
if ('random_list' == $orderby_value)
You can’t perform that action at this time.