Skip to content

Instantly share code, notes, and snippets.

View vitaliidasaev's full-sized avatar
🎖️
Let's help each other!

Vitalii D vitaliidasaev

🎖️
Let's help each other!
View GitHub Profile
@vitaliidasaev
vitaliidasaev / Guid.ts
Created July 2, 2020 13:02 — forked from emptyother/Guid.ts
GUID class for Typescript
class Guid {
public static newGuid(): Guid {
return new Guid('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
const r = Math.random() * 16 | 0;
const v = (c == 'x') ? r : (r & 0x3 | 0x8);
return v.toString(16);
}));
}
public static get empty(): string {
return '00000000-0000-0000-0000-000000000000';
@vitaliidasaev
vitaliidasaev / 0_reuse_code.js
Created July 15, 2016 15:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console