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
<? | |
/* | |
* Add the smartcode to the list | |
*/ | |
add_filter('fluentform_editor_shortcodes', function ($smartCodes) { | |
$smartCodes[0]['shortcodes']['{afl_session_landing_page}'] = 'AFL Session Landing Page'; | |
//$smartCodes[0]['shortcodes']['{afl_session_visit_date}'] = 'AFL Session Visit Date'; | |
$smartCodes[0]['shortcodes']['{afl_first_utm_url}'] = 'AFL First UTM URL'; | |
//$smartCodes[0]['shortcodes']['{afl_first_utm_visit_date}'] = 'AFL First UTM Visit Date'; | |
$smartCodes[0]['shortcodes']['{afl_first_utm_source}'] = 'AFL First UTM Source'; |
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
action: | |
- variables: | |
time_left: > | |
{% set event_start = as_timestamp(trigger.calendar_event.start) %} {% | |
set time_diff = (event_start - as_timestamp(now())) / 60 %} {% if | |
time_diff > 59 %} | |
1 hour | |
{% elif 29 <= time_diff < 59 %} | |
30 minutes | |
{% elif 14 <= time_diff < 29 %} |
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
using System; | |
using System.IO; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Extensions.Logging; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Threading.Tasks; | |
using System.Text.Json.Serialization; | |
namespace AJTDigital.Mux |
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
<? | |
add_filter("rank_math/opengraph/facebook/og_image", function($content) { | |
if(is_singular('articles') && is_main_query()){ | |
$ogimg = get_post_meta(get_the_ID(), '_dcms_eufi_img', true); | |
if(isset($ogimg) && !empty($ogimg)) | |
{ | |
return $ogimg; | |
} | |
} | |
return $content; |
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
{ | |
"@context": "https://schema.org", | |
"@graph": [ | |
{ | |
"@type": "Place", | |
"@id": "https://ajtatumdigital.com/#place", | |
"address": { | |
"@type": "PostalAddress", | |
"addressLocality": "Fairfax", | |
"addressRegion": "VA", |
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
add_filter('get_avatar', 'ajtd_get_avatar', 10, 6); | |
function ajtd_get_avatar($avatar, $id_or_email, $size, $default, $alt) { | |
$args['size'] = (int) $size; | |
$url2x = get_avatar_url($id_or_email, array_merge($args, array('size' => $args['size'] * 2))); | |
$args = get_avatar_data($id_or_email, $args); | |
$url = $args['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
var countryNameToCode = { | |
'Afghanistan': 'AF', | |
'Aland Islands': 'AX', | |
'Albania': 'AL', | |
'Algeria': 'DZ', | |
'American Samoa': 'AS', | |
'Andorra': 'AD', | |
'Angola': 'AO', | |
'Anguilla': 'AI', | |
'Antarctica': 'AQ', |
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
// add event cross browser | |
function addEvent(elem, event, fn) { | |
if (elem.addEventListener) { | |
elem.addEventListener(event, fn, false); | |
} else { | |
elem.attachEvent("on" + event, function () { | |
// set the this pointer same as addEventListener when fn is called | |
return fn.call(elem, window.event); | |
}); | |
} |
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
public async Task<List<string>> GetCacheKeys() | |
{ | |
var cacheKeys = new List<string>(); | |
var endpoints = Connection.GetEndPoints(); | |
var keys = Connection.GetServer(endpoints.First()).KeysAsync(); | |
var enumerator = keys.GetAsyncEnumerator(); | |
while (await enumerator.MoveNextAsync()) | |
{ | |
var key = enumerator.Current; |
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
var imageCdnUrl = Configuration["CDN:Images:CdnUrl"]; | |
app.Use(async (context, next) => | |
{ | |
context.Response.Headers.Add("Accept-CH", "viewport-width, width, dpr"); | |
context.Response.Headers.Add("Feature-Policy", $"ch-viewport-width {imageCdnUrl};ch-width {imageCdnUrl};ch-dpr {imageCdnUrl};ch-device-memory {imageCdnUrl};ch-rtt {imageCdnUrl};ch-ect {imageCdnUrl};ch-downlink {imageCdnUrl}"); | |
context.Response.Headers.Add("Permissions-Policy", $"ch-viewport-width {imageCdnUrl};ch-width {imageCdnUrl};ch-dpr {imageCdnUrl};ch-device-memory {imageCdnUrl};ch-rtt {imageCdnUrl};ch-ect {imageCdnUrl};ch-downlink {imageCdnUrl}"); | |
await next(); | |
}); |
NewerOlder