Playgroud:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export type Dictionary<T> = { | |
| [key: string]: T; | |
| }; | |
| export class GlobalStore { | |
| static get(key: string) { | |
| if (getGlobalStore().data === undefined) | |
| getGlobalStore().data = {}; | |
| if (getGlobalStore().data[key] === undefined) |
https://debugpointer.com/check-if-an-object-is-a-promise/
function isPromise(p) {
return p && Object.prototype.toString.call(p) === "[object Promise]";
}- Singleton
- Fluent Interface
- Observer
- Composite
- Abstract factory
https://www.netguru.com/codestories/top-5-most-used-patterns-in-oop-with-typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Legit auto pop by Noxturnix | |
| * Version 0.3 | |
| * | |
| * How to use: | |
| * 1. Go to https://popcat.click/ | |
| * 2. Press F12 | |
| * 3. Go to "Console" tab | |
| * 4. Ignore the warning. There's no such malicious codes in this script. You can try to understand the code if you want | |
| * 5. Copy and paste this script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| var fs = require('fs'), | |
| https = require('https'); | |
| // We pass our client key & cert to the http agent, | |
| // which we then use to make the request. | |
| var agentOptions = { | |
| key: fs.readFileSync('client.key'), | |
| cert: fs.readFileSync('client.crt'), |
Create a new repository, or reuse an existing one.
Generate a new SSH key:
ssh-keygen -t rsa -C "your_email@example.com"
Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).
Test SSH key: