Skip to content

Instantly share code, notes, and snippets.

View vhnam's full-sized avatar
💭
"Vision is what you see with your mind" - Robert T. Kiyosaki

Nam Vo vhnam

💭
"Vision is what you see with your mind" - Robert T. Kiyosaki
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vhnam
vhnam / mockTime.ts
Last active February 25, 2020 15:11
Overriding the default Date object in TypeScript/JavaScript
Date = new Proxy(Date, {
construct: (target: DateConstructor, args: any) => {
if (args.length === 0) {
return new target(2019, 11, 31, 18);
}
return new target(
...(args as [number, number, number, number, number, number, number]),
);
},
});
@vhnam
vhnam / gist-introduce-go.go
Created February 18, 2015 18:23
Demo Gist - GitHub
/**
* Demo Gist GitHub with Go
*
* Author: Nam Vo Hoai <vhnam2504@gmail.com>
*/
package main
import "fmt"
// Main function