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
$colors: ("blue", #0000ff, "green", #008000, "orange", #fca644); | |
@for $index from 1 through length($colors){ | |
div:nth-child(#{length($colors)}n + #{$index}) { | |
color: unquote(nth($colors, $index)); | |
} | |
} | |
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
/* | |
Adds !!todaysdate!! as an available variable for use in Paid Memberships Pro emails. | |
Notice the array key does not include the !!s | |
*/ | |
function my_pmpro_email_data($data, $email) | |
{ | |
$data['todaysdate'] = date(get_option("date_format")); | |
return $data; |
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 | |
//AJAX ADD TO CART BUTTON | |
$product_id = 143; | |
if( !my_custom_cart_contains( $product_id ) ) { | |
?> | |
<button class="my-custom-add-to-cart-button" data-product-id="<?php echo $product_id; ?>">add to cart</button> | |
<?php | |
} else { | |
?> |
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
// 𝔹𝕃𝔸𝕊𝕋 | |
// Run the following code manually through browser console with an opened conversation in WhatsApp (Web Version) | |
// STEP #1 | |
function sendMessageJs(message, count) { | |
for(var i = 0; i <= count; i++){ | |
window.InputEvent = window.Event || window.InputEvent; | |
var event = new InputEvent('input', { | |
bubbles: true | |
}); |
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
$('.toggle').on('click', function(e){ | |
e.preventDefault(); | |
// Do Something | |
$(this).text($(this).text() == 'View More' ? 'View Less' : 'View More'); | |
}) | |
## Add class to body based on the URL – jQuery | |
var urlPath = window.location.pathname; |
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
$.ajax({ | |
url: 'https://data-asg.goldprice.org/dbXRates/USD', | |
dataType: 'text', | |
success: function(response) { | |
var prices = JSON.parse(response).items[0]; | |
var goldp = prices.xauPrice; | |
var goldx = prices.chgXau; | |
var golds = (prices.xauPrice > prices.xauClose) ? 'up' : 'down'; | |
var silverp = prices.xagPrice; | |
var silverx = prices.chgXag; |
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
#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/ |
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
$(document).ready(function(){ | |
$.ajax({ | |
url:"https://www.instagram.com/{username}/channel/?__a=1", | |
type:'get', | |
success:function(response){ | |
posts = response.graphql.user.edge_owner_to_timeline_media.edges; | |
posts_html = ''; | |
for(var i=0;i<8;i++){ | |
url = posts[i].node.display_url; | |
post_shortcode = posts[i].node.shortcode; |
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
if(navigator.userAgent.match(/Trident\/7\./)) { | |
document.body.addEventListener("mousewheel", function() { | |
event.preventDefault(); | |
var wd = event.wheelDelta; | |
var csp = window.pageYOffset; | |
window.scrollTo(0, csp - wd); | |
}); | |
} |
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 | |
/** | |
* @license MIT | |
* @author Ruben Decleyn [email protected]> | |
* @created 12/02/2017 | |
*/ | |
namespace App\TwigExtensions; |