Skip to content

Instantly share code, notes, and snippets.

View anderly's full-sized avatar

Adam Anderly anderly

View GitHub Profile
anderly / Delete-Teams-Messages.js
Last active June 8, 2023 18:03 — forked from kiki67100/Delete-Teams-Messages.js
Delete batch messages Microsoft Teams
View Delete-Teams-Messages.js
(function() {
var JQ = jQuery("iframe").contents();
var queue = [];
var last_processed = (new Date()).getTime();
var loading = true;
var my_name = null;
var mouse = function(which, element) {
var evt = element.ownerDocument.createEvent('MouseEvents');
anderly / Startup.cs
Last active June 14, 2022 08:50
MediatR Pipeline Behavior Registration.
View Startup.cs
// Register MediatR Pipeline Behaviors
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CachingBehavior<,>));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(FallbackBehavior<,>));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RetryBehavior<,>));
// ICachePolicy discovery and registration
services.Scan(scan => scan
anderly / Details.cs
Last active December 12, 2019 19:52
MediatR Fallback Pipeline Behavior
View Details.cs
public class Handler : IRequestHandler<Query, Customer>, IFallbackHandler<Query, Customer>
private readonly ICustomerRepository _db;
private readonly ICustomerRepository<SourceSystem.Secondary> _db2;
private readonly IConfigurationProvider _configuration;
public Handler(ICustomerRepository db, ICustomerRepository<SourceSystem.Secondary> db2, IConfigurationProvider configuration)
_db = db;
_db2 = db2;
anderly / Details.cs
Last active December 12, 2019 19:48
MediatR Retry Pipeline Behavior
View Details.cs
public class Handler : IRequestHandler<Query, Customer>, IRetryableRequest<Query, Customer>
private readonly CustomerContext _db;
private readonly IConfigurationProvider _configuration;
// By implementing IRetryableRequest<TRequest, TResponse> I get the following
// properties to control how my "Handle" method will get retried.
public int RetryAttempts => 2;
public int RetryDelay => 500;
public bool RetryWithExponentialBackoff => true;
anderly / CacheService.cs
Last active April 4, 2023 23:54
MediatR Caching Pipeline Behavior
View CacheService.cs
public class CacheService : ICache
private readonly string _keyPrefix;
private readonly IDistributedCache _cache;
private readonly IConfiguration _config;
public CacheService(IDistributedCache cache, IConfiguration config)
_cache = cache;
_config = config;
anderly / FilterMenu.vue
Last active August 16, 2019 16:17
Make Laravel Nova Per Page options configurable both globally and at resource level.
View FilterMenu.vue
v-if="filters.length > 0 || softDeletes || !viaResource"
slot-scope="{ toggle }"
class="bg-30 px-3 border-2 border-30 rounded"
anderly / Index.vue
Created March 13, 2019 05:26
Make Index.vue support initializing viaResource, viaResourceId and viaRelationship from query string.
View Index.vue
<loading-view :loading="initialLoading" :dusk="resourceName + '-index-component'">
<custom-index-header v-if="!viaResource" class="mb-3" :resource-name="resourceName" />
<div v-if="shouldShowCards">
v-if="smallCards.length > 0"
anderly /
Last active September 17, 2016 19:10
Ideas for making ShowDown extensible

Ideas for making ShowDown extensible:

I recently had to customize your plugin a bit for a client but wanted to suggest a few hooks and filters that could be added to the plugin to create some extensibility points for your customers.

Here are the hooks I added which would be great if you could add them into the main plugin so I could still get updates without having to do diffs when the plugin gets updated.

1st set of changes: Adding hooks to Anti-Cheat settings

File: wpshowdown.php
anderly / woocommerce-add-custom-product-data-tab.php
Last active June 8, 2023 20:30
WooCommerce - Add Custom Product Data Tab
View woocommerce-add-custom-product-data-tab.php
// First Register the Tab by hooking into the 'woocommerce_product_data_tabs' filter
add_filter( 'woocommerce_product_data_tabs', 'add_my_custom_product_data_tab' );
function add_my_custom_product_data_tab( $product_data_tabs ) {
$product_data_tabs['my-custom-tab'] = array(
'label' => __( 'My Custom Tab', 'my_text_domain' ),
'target' => 'my_custom_product_data',
return $product_data_tabs;
anderly / DFP Interstitial Ad
Last active March 13, 2017 16:34
DFP Interstitial Ad Code
View DFP Interstitial Ad
var DmagInterstitialAd = DmagInterstitialAd || {};
DmagInterstitialAd.showInterstitial = true;
DmagInterstitialAd.adWidth = 720;
DmagInterstitialAd.adHeight = 480;
DmagInterstitialAd.destinationURL = ";dc_trk_aid=283955045;dc_trk_cid=59150503";
DmagInterstitialAd.embedCode = '<img src=";dc_trk_aid=283955045;dc_trk_cid=59150503;ord=[timestamp]?" border="0" height="1" width="1" alt="Advertisement">';