Skip to content

Instantly share code, notes, and snippets.

"use strict";!function(t,n){var r=/:scope\b/gi;function i(e){var s=t[e];t[e]=function(e){var t=this,n=t.id||"qsid"+(new Date).getTime(),i=!t.id,o=r.test(e);try{return o&&(i&&(t.id=n),e=e.replace(r,"#"+n)),s.call(this,e)}finally{i&&(t.id=null)}}}function o(e){var t=n[e];n[e]=function(e){return t.call(this,e.replace(r,""))}}try{document.querySelector(":scope")}catch(e){i("querySelector"),i("querySelectorAll"),o("querySelector"),o("querySelectorAll")}}(Element.prototype,Document.prototype),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.hasOwnProperty("append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),n=document.createDocumentFragment();e.forEach(function(e){var t=e instanceof Node;n.appendChild(t?e:document.createTextNode(String(e)))}),this.appendChild(n)}})}),function(){if("function"==typeof NodeList.prototype.forEach)return;NodeList.prototype.forEach=Array.prototype.forEach}
@Longkt
Longkt / WP Coupon - Support RTL
Last active October 2, 2020 08:00
WP Coupon - Support RTL
/*
Theme Name: WP Coupon
Adding support for language written in a Right To Left (RTL) direction is easy -
it's just a matter of overwriting all the horizontal positioning attributes
of your CSS stylesheet in a separate stylesheet file named rtl.css.
http://codex.wordpress.org/Right_to_Left_Language_Support
*/
.store-letter-content ul li:before,i.icon.angle.right:before {
jQuery(function(t){var e,s,a,i,c,o=t(document),r=t("#masthead"),d=0;function n(){if(s=e.height(),t("#page-cover").css("padding-top",""),t("body").hasClass("is-header-transparent")){var a=t("#page-cover").css("padding-top");a=parseInt(a),(isNaN(a)||a<=0)&&t("#page-cover").css("padding-top",s)}else t("#page-cover").css("padding-top","")}function h(){n(),r.removeAttr("style"),r.css("min-height","auto"),r.length?(s=r.height(),r.css({"min-height":s,display:"block"}),a=r.offset()):a={top:0,left:0},n();var i=0;t("#wpadminbar").length&&(i=t("#wpadminbar").height()),e.css("top",i)}e=t("#masthead-inner"),r=t("#masthead"),n(),h();var y=function(o){void 0===o&&(o=t(window).scrollTop()),"object"!=typeof a&&(a={top:0,left:0});var d=a.top+s+100;if(o>0){var n=0;t("#wpadminbar").length&&(n=t("#wpadminbar").height(),"absolute"==t("#wpadminbar").css("position")&&(n=0)),r.removeClass("sticky-hiding"),r.addClass("sticky"),e.css("top",n),c&&(clearTimeout(c),c=!1),r.hasClass("sticky-active")||i||(t(".header--sticky",r).each(functio
<html lang=&quot;en&quot;> <head> <title>gateway</title> <meta http-equiv=&quot;Expires&quot; content=&quot;28FEB2002&quot; /> <meta http-equiv=&quot;CACHE-CONTROL&quot; content=&quot;NO-CACHE&quot; /> <script type=&quot;text/javascript&quot;> function addFields(formObj){}function redirect(commitType){var cookieenabled=false;if(navigator.cookieEnabled){if(navigator.cookieEnabled==true){var exdate=new Date();exdate.setDate(exdate.getDate()+1);document.cookie=&quot;DGCC=&quot;+escape(genPid())+&quot;;path=/;expires=&quot;+exdate.toGMTString();cookieenabled=(document.cookie.indexOf(&quot;DGCC&quot;)!=-1)? true : false;}}if(cookieenabled){if(commitType==&quot;reload&quot;)window.location.reload(true);else{var oFrm=document.createElement(&quot;form&quot;);var oEnvlp=document.getElementById(&quot;frmPlsHldr&quot;);oFrm.method=&quot;post&quot;;addFields(oFrm);oEnvlp.appendChild(oFrm);oFrm.submit();}}else{var oJSCookieMSGObj=document.getElementById('JSCookieMSG');oJSCookieMSGObj.style.display='block';}}</script> </he
== Changelog ==
## 1.3.0
* FIXED: js error in page theme options.
## 1.2.9
* NEW: add option to show/hide the post meta on single post.
* NEW: add option to enable/disable group of expired coupons.
## 1.2.8
* NEW: add option to hide the "submit a coupon" on store page.
* NEW: support RTL for coupon slider & carousel.
* IMPROVED: Update a small typo issue.
/**
* Set Cookie
*
* @param cname
* @param cvalue
* @param exdays
*/
function setCookie( cname, cvalue, exdays ) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
<?php
/**
* News Recent Posts
*/
class my_passionate_recent_posts extends WP_Widget {
public function __construct() {
parent::__construct(
'passionate_recent_posts',
/**
* Shipping City for WooCommerce
*
* @author longnguyen [email protected]
* https://profiles.wordpress.org/longnguyen
*/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
add_action( 'woocommerce_shipping_init', 'woocommerce_shipping_city_init' );
add_filter( 'woocommerce_shipping_methods', 'woocommerce_shipping_city_method' );
<?php
$google_fonts = '
{
"kind": "webfonts#webfontList",
"items": [
{
"kind": "webfonts#webfont",
"family": "ABeeZee",
@Longkt
Longkt / OnePress theme.js (change isMobile function to onepressIsMobile)
Last active May 4, 2019 04:03
OnePress theme.js (change isMobile function to onepressIsMobile)
var onepressIsMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},