Skip to content

Instantly share code, notes, and snippets.

@danielmilner
danielmilner / wordpressPluginStats.js
Last active September 7, 2021 21:46
WordPress plugin stat widget for iOS 14 and Scriptable app
/**
* Setup Begin
*/
const pluginSlug = "hey-notify";
const backgroundColor = "#009bff"; // In HEX format
const textColor = "#ffffff"; // In HEX format
/**
* Setup End
*/
@danielmilner
danielmilner / person-tags.lava
Last active May 9, 2018 16:19
Rock - Attended Check-in - Confirmation - Person Tags #rockrms
{% assign styleBase = 'display: inline-block; font-size: 13px; margin: 0 5px 5px 0; padding: 3px 5px; border-radius: 5px;' %}
{% assign styleBirthday = 'background-color: #b9d4ec; color: #245682;' %}
{% assign styleAllergy = 'background-color: #e3151a; color: #fff;' %}
{% assign styleLegal = 'background-color: yellow; color: #000;' %}
{% capture BirthDayLastYear %}{{ Person.BirthMonth | ToString }}/{{ Person.BirthDay | ToString }}/{{ 'Now' | DateAdd:-365,'d' | Date:'yyyy' }}{% endcapture %}
{% assign BirthDayLastYearDays = 'Now' | DateDiff:BirthDayLastYear,'d' %}
{% capture BirthDayThisYear %}{{ Person.BirthMonth | ToString }}/{{ Person.BirthDay | ToString }}/{{ 'Now' | Date:'yyyy' }}{% endcapture %}
{% assign BirthDayThisYearDays = 'Now' | DateDiff:BirthDayThisYear,'d' %}
{% capture BirthDayNextYear %}{{ Person.BirthMonth | ToString }}/{{ Person.BirthDay | ToString }}/{{ 'Now' | DateAdd:365,'d' | Date:'yyyy' }}{% endcapture %}
@danielmilner
danielmilner / edd-sl-time-based-prorate-limit.php
Last active May 9, 2018 16:18
EDD Software Licensing Time-Based Prorate Limit #edd
add_filter( 'edd_sl_get_time_based_pro_rated_upgrade_cost', 'my_prefix_edd_sl_time_based_prorate_limit', 10, 4 );
function my_prefix_edd_sl_time_based_prorate_limit( $prorated, $license_id, $old_price, $new_price ) {
$price_difference = $new_price - $old_price;
$protate_limit_percent = '50';
$prorate_limit_price = round( ( $price_difference / 100 ) * $prorate_limit_percent );
if ( $prorated < $prorate_limit_price ) {
return round( $prorate_limit_price, edd_currency_decimal_filter() );
}
@danielmilner
danielmilner / functions.php
Last active May 9, 2018 16:20
Beaver Tunnels - Storefront Theme #beavertunnels
add_filter( 'beaver_tunnels', 'storefront_beaver_tunnels_actions' );
function storefront_beaver_tunnels_actions( $actions = array() ) {
$actions[] = array(
'title' => __( 'Storefront', 'storefront' ),
'actions' => array(
'storefront_before_header',
'storefront_header',
'storefront_before_content',
'storefront_content_top',
'homepage',