Skip to content

Instantly share code, notes, and snippets.

@mejdzer
mejdzer / countdown-clock.html
Created November 8, 2019 15:17 — forked from peternatewood/countdown-clock.html
A simple, efficient countdown clock. No jQuery required.
<!DOCTYPE html>
<html>
<head>
<title>Countdown Clock</title>
<meta charset="utf-8"/>
<style type="text/css">
#countdown-container {
display: -ms-flex;
display: -moz-flex;
display: -webkit-flex;
<?php
/**
* Render dataLayer on a WooCommerce thank you page.
* This file should be added at the end of Theme Functions (functions.php)
*
* Official Class descriptions:
* https://docs.woocommerce.com/wc-apidocs/class-WC_Abstract_Order.html
* https://docs.woocommerce.com/wc-apidocs/class-WC_Order.html
* https://docs.woocommerce.com/wc-apidocs/class-WC_Order_Item.html
* https://docs.woocommerce.com/wc-apidocs/class-WC_Abstract_Legacy_Order.html
@mejdzer
mejdzer / attach_query_string.js
Last active August 29, 2015 14:04
Attach a query string to the links on the page
$('a').each(function() {
if (location.search.substr(1) !== '') {
query = location.search.substr(1);
symbol = $(this).attr('href').indexOf("?") == -1 ? '?' : '&';
$(this).attr('href', $(this).attr('href') + symbol + query);
}
});
@mejdzer
mejdzer / explode_to_assoc.php
Last active November 13, 2022 04:40
Split a string by string and put into an associative array.
<?php
/**
* Explode the strings delimited with a given string/character
* into an associative array.
*
* Function alters $new_array associative array passed to the function
* by reference. This array should contain keys and values. Example.:
* $new_array = array(
* 'bananas' => '',