- [Vim]
- Disable
CTRL+CandCTRL+V
"vim.handleKeys": { "<C-c>": false, "<C-v>": false } - Disable
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 |
- Singleton
- Fluent Interface
- Observer
- Composite
- Abstract factory
https://www.netguru.com/codestories/top-5-most-used-patterns-in-oop-with-typescript
https://debugpointer.com/check-if-an-object-is-a-promise/
function isPromise(p) {
return p && Object.prototype.toString.call(p) === "[object Promise]";
}
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) |
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
| import 'reflect-metadata'; | |
| import { ReflectiveInjector, Injectable, Injector } from 'injection-js'; | |
| class Service { | |
| get() { | |
| return "my service"; | |
| } | |
| } | |
| class Service2 { |
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
| // Credit | |
| // https://www.stevefenton.co.uk/2014/07/creating-typescript-classes-dynamically | |
| // https://gist.github.com/mfdeveloper/c337408608d6033fde967fc2e76b12c4 | |
| interface ObjectKeyString { | |
| [key: string]: any; | |
| } | |
| class InstanceLoader { |