Skip to content

Instantly share code, notes, and snippets.

View deksoke's full-sized avatar

taywan deksoke

View GitHub Profile
@deksoke
deksoke / 1-install-container.bat
Created April 16, 2019 10:23
Install Container & Hyper-V in Windows 10 Home
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*containers*.mum >containers.txt
for /f %%i in ('findstr /i . containers.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del containers.txt
Dism /online /enable-feature /featurename:Containers -All /LimitAccess /ALL
pause
@deksoke
deksoke / custom-http-interceptor.ts
Last active March 14, 2019 17:47
Custom OData Query String with Http Interceptor
import { Injectable } from '@angular/core';
import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest, HttpErrorResponse, HttpResponse } from '@angular/common/http';
@Injectable()
export class CustomInterceptor implements HttpInterceptor {
constructor() { }
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (request.params.has('$count')) {
var isPopupBlocked = function() {
var isBlocked,
popup = window.open('about:blank', 'popup_test','width=5, height=5, left=0, top=0');
// pop under
if(popup) popup.blur();
window.focus();
isBlocked = !popup || typeof popup == 'undefined' || typeof popup.closed=='undefined' || popup.closed || popup.innerHeight == 0;
if(popup) popup.close();