Skip to content

Instantly share code, notes, and snippets.


Trung Vo trungk18

View GitHub Profile
huytd /
Last active May 18, 2023 02:13
Wordle in less than 50 lines of Bash


How to use:


Or try the unlimit mode:

pjlamb12 / google-analytics.service.ts
Created August 21, 2020 22:33
Example Google Analytics service for Angular apps
View google-analytics.service.ts
import { Injectable, Renderer2, Inject, RendererFactory2 } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { RuntimeConfigLoaderService } from 'runtime-config-loader';
import { Router, RouterEvent, NavigationEnd } from '@angular/router';
import { filter, tap } from 'rxjs/operators';
declare let gtag: Function;
providedIn: 'root',

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

View app.module.ts
imports: [OAuthModule.forRoot({...})] // <-- how to use the configuration.json here
export class AppModule {
constructor(@Inject(AppConfig) private readonly appConfig: AppConfiguration) {} // I can inject
View ll-20.ts
import { ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, Input, Type, ViewContainerRef } from '@angular/core';
import { Subscription } from 'rxjs';
selector: '[lazyComp]'
export class LazyCompDirective {
private _inputs;
private _outputs;
private subscription = new Subscription();
klement97 / error.handler.ts
Last active March 14, 2023 06:48
A central solution to error handling in Angular Reactive Forms
View error.handler.ts
import {AbstractControl, FormArray, FormControl, FormGroup, ValidationErrors} from '@angular/forms';
import {Injectable} from '@angular/core';
import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
export declare interface ServerError {
[key: string]: [];
laughinghan / Every possible TypeScript
Last active May 22, 2023 16:27
Diagram of every possible TypeScript type
View Every possible TypeScript

Hasse diagram of every possible TypeScript type

  • any: magic, ill-behaved type that acts like a combination of never (the proper [bottom type]) and unknown (the proper [top type])
    • Anything except never is assignable to any, and any is assignable to anything at all.
    • Identities: any & AnyTypeExpression = any, any | AnyTypeExpression = any
    • Key TypeScript feature that allows for [gradual typing].
  • unknown: proper, well-behaved [top type]
    • Anything at all is assignable to unknown. unknown is only assignable to itself (unknown) and any.
    • Identities: unknown & AnyTypeExpression = AnyTypeExpression, unknown | AnyTypeExpression = unknown
  • Prefer over any whenever possible. Anywhere in well-typed code you're tempted to use any, you probably want unknown.
nartc / load-module.directive.ts
Created November 19, 2019 16:04
Angular - LazyLoad non-route Module Directive
View load-module.directive.ts
import {
nartc /
Last active June 18, 2022 08:49 — forked from nhim175/
Văn hoá CodersX team

Văn hoá CodersX

CodersX là một. Chúng ta hoạt động vì một mục đích duy nhất: Thay đổi thế giới một cách tích cực, bắt đầu bằng việc tạo nên một nền giáo dục miễn phí.


  1. Thay đổi thế giới ← 2. Cùng nhau làm các startup có ảnh hưởng tích cực tới cuộc sống xung quanh ← 1. Làm mới hệ thống giáo dục ← 0. Giúp tất cả mọi người tiếp cận với lập trình

Giúp đỡ các thành viên trong team

Một team chỉ mạnh khi tất cả mọi người support lẫn nhau, và cùng nhau làm việc vì một mục tiêu duy nhất. Nếu chỉ nghĩ đến bản thân thì một lúc nào đó team sẽ tan rã (nếu nhiều người cùng nghĩ về bản thân), hoặc tự loại mình ra khỏi team.

Nghĩ tới người xung quanh

johncip /
Last active November 1, 2022 18:59
Moving from Phaser 2 to 3

Moving from Phaser 2 → 3: an incomplete guide


  • I found that the best thing was to ask myself what this or that line was meant to accomplish, and then to search for a Phaser 3 example of that task.
  • Usually the issue is just that a function has moved, or some property now requires a setter.
  • There's a real migration guide here: part 1, part 2

Scenes have replaced states (and the game object… mostly)