Skip to content

Instantly share code, notes, and snippets.

@bmodena
bmodena / getAge.js
Created December 8, 2020 19:15
Javascript Get Age for over 18 or over 21 DOB validation
/*
* Pass a date string into the function and return the age
* dateString = MM/DD/YYYY
---------------------
*/
function getAge(dateString) {
var today = new Date(),
birthDate = new Date(dateString),
age = today.getFullYear() - birthDate.getFullYear(),
@bmodena
bmodena / .htaccess
Created December 10, 2019 16:33
Increase max file upload size on WP Engine
# adjust filesize to be what you need
# add this to your .htacess file on the server
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
@bmodena
bmodena / local-images.txt
Last active October 8, 2022 12:45
Production images on Local development environment in Wordpress
# ReWrite image URLS to pull from production enviroment
# 1 - add this to your .htacess file
# 2 - swap [YOUR-DOMAIN] withy our production domain name
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$
RewriteRule ^(.*)$ https://[YOUR-DOMAIN].com/$1 [QSA,L]
@bmodena
bmodena / Buckrail-Image-Link.html
Last active February 21, 2018 19:22
Buckrail Image Link
@bmodena
bmodena / buckrail-text.html
Last active February 21, 2018 19:22
Buckrail Text Link Share
<a href="https://buckrail.com" title="Jackson, WY News">Buckrail - Jackson Hole, WY News</a>
@bmodena
bmodena / shopify-clearcart.js
Last active September 21, 2022 19:19
Shopify Clear Cart Cookie on logout
/*
@require
Jquery: https://jquery.com/
*/
function delete_cookie(name) {
document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
// logout link
@bmodena
bmodena / shopify-discount-from-cookie.js
Last active May 2, 2019 10:08
Add discount code to checkout from URL
@bmodena
bmodena / analytics-event.js
Last active February 22, 2017 18:34
Simple analytics event tracking
/*
Add a data attr of event to a tag and push to analytics
@req : jquery
*/
<a href="http://google.com" class="btn" data-event="footer-action">Download Now</a>
<script type="text/javascript">
@bmodena
bmodena / wp-bootstrap-grid_shortcode.php
Created June 21, 2016 15:12
Boostrap Grid / Cols Short Codes
/*
* BOOSTRAP GRID SHORT CODES
* Req : Bootstrap - http://getbootstrap.com/
* add this code to functions.php or a shortcodes.php include
* Use in WISIWIG
---------------------------------------------
[one_third] Content third [/one_third]
[one_third] Content third [/one_third]
[one_third] Content thrid [/one_third]
@bmodena
bmodena / wp_featured_image_feed.php
Created June 16, 2016 14:41
Wordpress Featured Image in RSS Feed