vmware intelligent hub android app issue

We use vmware Intelligent hub (previously known as airwatch on Android for work related apps like slack and G Suite. Problems with Hub(Airwatch) After Installing it, I found several issues. face unlock is disabled ( I am using a Galaxy S8+). Neither can I use pattern unlock any more. I was forced to use 8…

Debug browser code in vscode

One of the selling point of vscode is its built-in debugger. It is quite powerful but not the easiest thing to setup . Debugging Nodejs code is kind of straightforward as usually it is a standalone file or sometime an entry server file. I have a blog on debug typescript mocha and server in vscode. However…

vim system clipboard setup

How vim interact with the system clipboard is something always tricky and debatable as vim carries its own register. Current Setting My previous way is using the vim register for operations like y, d, x etc and use a mapping of ctrl+c to copy the content to system clipboard like vmap <C-c> “+y to copy…

typeof and Mapped type in Typescript

I was reading an article introducing the usage of the typeof and Mapped type which was introduced back in TS 2.1. It is quite interesting that typescript can actually make generic of generic and infer the types of properties and then use them for border extensions. For typeof it basically yields the type of permitted property names. A keyof…

My first TS custom decorator

Background Was reading some nestjs related documentation and found the custom decorator portion quite interesting. So decided to write one myself. Decorator vs Annotation Syntax-wise decorator in Typescript is quite similar to the annotation in Java where we can assign metadata information to class/field/method. However under the hood, they are quite different. One of the major…

Google home not responding to ‘Hey Google’ but ‘Okay Google’

Recently I found my Google home becomes a bit silly. It never responds to my Hey Google command any more like before. However Okay Google still works. Also while playing my Google music playlists, it randomly stops and drops songs which is quite annoying. Then I notice in the version, its language value is Japanese which I set…

site diff tool with puppeteer

Background   We recently have a requirement to do a site diff tool so that we can compare our pages in qa and prod to make sure the changes go in is expected. Existing Stack There used to be a version that works but a bit complicated. The existing stack is user provides a list…

lambda@edge prototype

Recently I was doing a MVP for replacing a ELB/EC2/Docker based static site preview stack with a cloudfront/lambda/s3 based one. Background The purpose of this is to reduce the maintenance we has to do with the EC2 stack like regular AMI update. reduce the complexity of the stack  as the previous one involves building custom…

nginx reverse proxy S3 files

China access issue Recently some of our church site users reported that the sermon audio/video download feature does not work any more. We recently moved our large files from file system to s3. After some research looks like the aws s3 is blocked by the famous Chinese Great FireWall(GFW). Possible Solutions Moving files back to…

pipe operator in rxjs

Pipe is introduced so that we can combine any number of operators. const source$ = Observable.range(0, 10); source$ .filter(x => x % 2) .reduce((acc, next) => acc + next, 0) .map(value => value * 2) .subscribe(x => console.log(x)); Above can be converted to: const source$ = Observable.range(0, 10); source$.pipe( filter(x => x % 2), reduce((acc,…

unsubscribe in rxjs(angular 2+)

background In reactive world(rxjs/ng2+), it is common and convenient to just create some subject/observable and subscribe to them for event handling etc. It is like the gof observer pattern​ out of the box. issue One caveat we recently have is, we call subscribe() of some subjects from our service in our ngOnInit or ngAfterViewInit funtions we forget to…

sessionStorage/localStorage scope

Firstly, localStorage and sessionStorage are 2 objects on the window object. They tie to the origin of the current window. As a result they are bind to : protocol, http/https are different domain subdomain can share with parent by manually setting document.domain. xxx.capitalone.com cannot share with yyy.capitalone.com port Same thing apply to 302 redirect. The session/local storage value…