Skip to content

Instantly share code, notes, and snippets.

View screamingworld's full-sized avatar

Markus Herkommer screamingworld

View GitHub Profile
@screamingworld
screamingworld / jsts-event-listener-solution.ts
Created January 16, 2022 21:05
JS/TS add/remove event listener with a local function saved in a instance var which uses
class Solution extends TestSetting {
private clickEventHandler:any;
public addEventListener() {
this.removeEventListener();
if (this.element == null) {
return;
}
@screamingworld
screamingworld / use-defined-method-which-returns-event-handler.ts
Created January 16, 2022 21:02
JS/TS add/remove event listener with a defined method which returns an event handler
class UseDefinedMethodWhichReturnsEventHandler extends TestSetting {
public addEventListener() {
this.removeEventListener();
if (this.element == null) {
return;
}
this.element.addEventListener("click", this.onClickEventHandler);
@screamingworld
screamingworld / use-anonymous-event-handler.ts
Created January 16, 2022 21:01
JS/TS add/remove event listener with an anonymous event handler
class UseAnonymousEventHandler extends TestSetting {
public addEventListener() {
this.removeEventListener();
if (this.element == null) {
return;
}
this.element.addEventListener("click", () => {
@screamingworld
screamingworld / use-defined-event-handler.ts
Last active January 16, 2022 20:59
JS/TS add/remove event listener with an defined event handler
class UseDefinedEventHandler extends TestSetting {
public addEventListener() {
this.removeEventListener();
if (this.element == null) {
return;
}
this.element.addEventListener("click", this.onClickEventHandler);
@screamingworld
screamingworld / test-setting.ts
Created January 16, 2022 20:57
Base class for testing js/ts event listener
class TestSetting {
protected element:HTMLElement | null;
constructor () {
let div = document.createElement('div');
div.setAttribute('id', 'elementToClick');
document.body.appendChild(div);
this.element = document.getElementById('elementToClick');
}
@screamingworld
screamingworld / variables.csv
Created March 1, 2021 23:28
Notifier - web api variables
Name Value Scope
DOMAIN_URL_BASE_NAME notifier.com Release
DOMAIN_URL_SUFFIX -acc acc
DOMAIN_URL_SUFFIX -prd prd
ENVIRONMENT acc acc
ENVIRONMENT prd prd
RELEASE_ARTIFACTS_BUILD_NOTIFIER_BUILDID $(Build.BuildId) Release
ApplicationInsights__InstrumentationKey $(ApplicationInsights — InstrumentationKey) Release
EventHubSettings__ConnectionString $(EventHubSettings — ConnectionString) Release
StorageSettings__ConnectionString $(StorageSettings — ConnectionString) Release
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Logging;
using Notifier.WebApi.Models;
using Notifier.WebApi.Services;
using System.Threading;
using System.Threading.Tasks;
namespace Notifier.WebApi.Controllers
{
@screamingworld
screamingworld / azure-pipeline.yaml
Created March 1, 2021 21:05
Notifier - web api pipeline 3
steps:
- checkout: self
- checkout: Common
- task: Docker@1
displayName: Build Image ACC
inputs:
containerregistrytype: $(ContainerRegistryType)
azureSubscriptionEndpoint: $(ServiceConnectionEndpoint)
azureContainerRegistry: 'notifiercontainerregistryacc.azurecr.io'
command: 'Build an image'
@screamingworld
screamingworld / azure-pipeline.yaml
Last active March 1, 2021 21:05
Notifier - web api pipeline 2
trigger:
branches:
include:
- master
resources:
repositories:
- repository: self
- repository: Common
type: git
@screamingworld
screamingworld / azure-pipeline.yaml
Created March 1, 2021 21:02
Notifier - web api pipeline 1
trigger:
- master
resources:
repositories:
- repository: self
pool:
vmImage: 'ubuntu-latest'