Skip to content

Instantly share code, notes, and snippets.

@leniency
leniency / kendo.extensions.popup.js
Last active November 2, 2015 21:43
Extension for kendo popups to automatically append them to Bootstrap modals, if no other append set.
;//
// Popup extension.
// Sets up kendo popups (used in all sorts of widgets) to check if the widget
// is being included in a bootstrap modal. If so, the popup should append to
// the modal instead of the page body.
//
// For the most part, popups work fine without this. However, DropdownList with
// a filter option does not. This is because the filter attempts to focus on
// filter input, which is outside the modal By default, Bootstrap modal will
// block this. It has an option to allow, but then it must be remembered to add
@leniency
leniency / AutofacServiceLocator.cs
Created June 7, 2018 22:48
Some extensions for Hangfire and Autofac. Allows multiple background tasks to be queued for Hangfire processing. Simply call the interface method - autofac resolves the concretes and then the extension will queue the method calls.
/// <summary>
/// Implementation of the IServiceLocator.
/// Mostly from https://github.com/autofac/Autofac.Extras.CommonServiceLocator,
/// minus the dependencies.
/// </summary>
public class AutofacServiceLocator : IServiceLocator
{
/// <summary>
/// The <see cref="Autofac.IComponentContext"/> from which services
/// should be located.
$ResourceLocation = "Global"
$ResourceGroup = "RESOURCE GROUP"
$ResourceName = "DOMAIN NAME"
$PropertiesObject = @{
'Consent' = @{
'AgreementKeys' = @("DNPA","DNTA");
'AgreedBy' = 'IP ADDRESS';
'AgreedAt' = '2017-04-23T04:07:00.0000000Z';
};
'authCode' = 'AUTH CODE';
@leniency
leniency / DebounceAttribute.cs
Created November 5, 2018 18:45
Job filter for Hangfire.io that throttles executions with a debounce filter. Multiple calls to the action will be ignored and only a single instance queued after the lock timout.
/// <summary>
/// A debounce rate limitor for Hangfire background jobs. This puts a
/// timeout lock on the action when it is first enqueued and schedules it
/// for the end of the lockout. Any further calls within the lock period are discarded.
/// </summary>
/// <remarks>
/// General references:
/// https://gist.github.com/odinserj/334fdb7d18bd63451f2f34546985f639
/// https://gist.github.com/odinserj/a8332a3f486773baa009
/// </remarks>
@leniency
leniency / timezone-mappings.csv
Created December 28, 2023 18:28 — forked from alejzeis/timezone-mappings.csv
Linux-Windows Timezone Mappings CSV
AUS Central Standard Time 001 Australia/Darwin
AUS Central Standard Time AU Australia/Darwin
AUS Eastern Standard Time 001 Australia/Sydney
AUS Eastern Standard Time AU Australia/Sydney Australia/Melbourne
Afghanistan Standard Time 001 Asia/Kabul
Afghanistan Standard Time AF Asia/Kabul
Alaskan Standard Time 001 America/Anchorage
Alaskan Standard Time US America/Anchorage America/Juneau America/Metlakatla America/Nome America/Sitka America/Yakutat
Aleutian Standard Time 001 America/Adak
Aleutian Standard Time US America/Adak