This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.myModule = window.myModule || {}; | |
myModule.upsellReload = (function() { //global function call from anywhere | |
console.log('Upsell added!'); | |
location.reload(); | |
}); | |
myModule.upsellReload(); //Call function from anywhere |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button class="js-download-link button" onclick="downloadFile('https://wattswork.s3.amazonaws.com/test-media/video/test_Drop-1280x720-16-9-HD.mp4','dwn.mp4'); return false;">Download MP4 File</button> | |
<button class="js-download-link button" onclick="downloadFile('https://wattswork.s3.amazonaws.com/test-media/PDFs/test-file.pdf','tfile.pdf'); return false;">Download PDF File</button> | |
<button class="js-download-link button" onclick="downloadFile('https://wattswork.s3.amazonaws.com/test-media/Text/test-file.txt','file.txt'); return false;">Download TXT File</button> | |
<script type="text/javascript"> | |
function downloadFile(data, fileName, type="text/plain") { | |
// Create an invisible A element | |
const a = document.createElement("a"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
// BigDump ver. 0.36b from 2015-04-30 | |
// Staggered import of an large MySQL Dump (like phpMyAdmin 2.x Dump) | |
// Even through the webservers with hard runtime limit and those in safe mode | |
// Works fine with latest Chrome, Internet Explorer and Firefox | |
// Author: Alexey Ozerov (alexey at ozerov dot de) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$post = array( | |
'import_id' => 9999, | |
'comment_status' => 'open', | |
'post_content' => 'hi world!', | |
'post_name' => 'title_1', | |
'post_status' => 'publish', | |
'post_title' => 'your title', | |
'post_type' => 'post', | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use momentjs for display dynamic time. | |
https://momentjs.com/docs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="page-wrap"> | |
<h1 id="top">Smooth Page Scrolling</h1> | |
<ul> | |
<li><a href="#two">Scroll to Section Two</a></li> | |
<li><a href="#three">Scroll to Section Three</a></li> | |
</ul> | |
<h2 id="one">Section One</h2> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP memory limit for this site | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
// Database | |
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
// Explicitely setting url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="instagram-feed1" class="instagram_feed"></div> | |
https://github.com/jsanahuja/jquery.instagramFeed | |
https://www.sowecms.com/demos/InstagramFeed/ | |
<script > | |
(function($){ | |
$(window).on('load', function(){ | |
$.instagramFeed({ | |
'username': '{{ section.settings.instagram_id | escape }}', | |
'container': "#instagram-feed1", | |
'display_profile': false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% form 'currency' %} | |
<select name="currency"> | |
{% for currency in shop.enabled_currencies %} | |
{% if currency == cart.currency %} | |
<option selected="true">{{currency.iso_code}} {{currency.symbol}}</option> | |
{% else %} | |
<option>{{currency.iso_code}}</option> | |
{% endif %} | |
{% endfor %} | |
</select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dropdownChange(){ | |
var byDate = document.getElementById('filter-by-date').value; | |
var myUrl = addQSParm('cat_type',cat_type); | |
var myUrl = addQSParm('keyword',sKeyword, myUrl); | |
window.location.href = myUrl; | |
} | |
/************************************************** | |
@ Constructing a URL with parameters using jQuery |