Skip to content

Instantly share code, notes, and snippets.

View imran3's full-sized avatar

Imran Azam imran3

  • UK
View GitHub Profile
#EXTM3U
#EXTINF:-1 tvg-id="92NewsUK.uk" tvg-logo="https://i.imgur.com/nAldca2.png" group-title="News",92 News UK (576p)
https://securecontributions.sechls01.visionip.tv/live/securecontributions-securecontributions-92_news-hsslive-25f-16x9-SD/chunklist.m3u8
#EXTINF:-1 tvg-id="AriseNews.uk" tvg-logo="https://i.imgur.com/B5IXKIb.png" group-title="News",Arise News (576p)
https://liveedge-arisenews.visioncdn.com/live-hls/arisenews/arisenews/arisenews_web/master.m3u8
#EXTINF:-1 tvg-id="BBCAlba.uk" tvg-logo="https://i.imgur.com/36KDxLg.png" group-title="General",BBC Alba (720p) [Geo-blocked]
https://vs-cmaf-pushb-uk.live.fastly.md.bbci.co.uk/x=4/i=urn:bbc:pips:service:bbc_alba/iptv_hd_abr_v1.mpd
#EXTINF:-1 tvg-id="BBCFour.uk" tvg-logo="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/BBC_Four_logo_2021.svg/512px-BBC_Four_logo_2021.svg.png" group-title="Culture;Documentary",BBC Four HD (720p) [Geo-blocked]
https://vs-cmaf-pushb-uk.live.fastly.md.bbci.co.uk/x=4/i=urn:bbc:pips:service:bbc_four_hd/iptv_hd_abr_v
@imran3
imran3 / retry-http-errors.interceptor.spec.ts
Last active July 24, 2024 17:53
Retry http errors mechanism in Angular
import { HttpClient, HttpErrorResponse, HttpResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
import { AppConfig } from '../../services/app-config/app-config.interface';
import { AppConfigService } from '../../services/app-config/app-config.service';
import { MOCK_APP_CONFIG } from '../../services/app-config/mock/get-config.mock';
import { RetryHttpErrorsInterceptor } from './retry-http-errors.interceptor';
describe('RetryHttpErrorsInterceptor', () => {
@imran3
imran3 / AppConfigService.js
Last active October 4, 2021 20:59
Runtime configuration for Angular apps
//AppConfig.d.ts
export interface AppConfig {
appInsightsKey: string;
}
//AppConfigService.ts
@Injectable()
export class AppConfigService {
private config: AppConfig;
loaded = false;
@imran3
imran3 / ApplicationInsightsErrorHandler.js
Last active October 1, 2021 20:21
Application Insights snippet for Angular apps
@Injectable()
export class ApplicationInsightsErrorHandler extends ErrorHandler {
constructor(private injector: Injector) {
super();
}
handleError(error: any): void {
// injecting ApplicationInsightService via injector to avoid infinite loop in case
// error is with service itself
this.injector.get<ApplicationInsightsService>(ApplicationInsightsService).logException(error);
@imran3
imran3 / SumOfDigits.ts
Last active September 23, 2020 10:57
Review a sequence of digits and find the sum of all digits that match the next digit in the list.
/*
Problem:
Review a sequence of digits and find the sum of all digits that match the next digit in the list.
The list is circular, so the digit after the last digit is the first digit in the list.
Input samples:
1122 produces a sum of 3 (1 + 2) because the first digit (1) matches the second digit and the third digit (2) matches
the fourth digit.
1111 produces 4 because each digit (all 1) matches the next.
1234 produces 0 because no digit matches the next.

Keybase proof

I hereby claim:

  • I am imran3 on github.
  • I am imran3 (https://keybase.io/imran3) on keybase.
  • I have a public key whose fingerprint is 290A 0FA8 04EB CE36 7B90 571F 9B44 2CC2 9220 AE1D

To claim this, I am signing this object: