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
| // How to write typesafe mixins in TypeScript | |
| // This type is required and basically includes all classes. | |
| // Remember: We use `new` instead of `constructor` in types, | |
| // and everything that is `new`-able is a class in TypeScript. | |
| type ClassConstructor = new(...args: any[]) => {}; | |
| // This mixin safely adds new methods to any class. | |
| function myMixin<C extends ClassConstructor>(Class: C) { | |
| return class extends Class { |
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
| // Either import Bootstrap variables or use these: | |
| $xs-lower-bound: 0px !global; | |
| $xs-upper-bound: 575px !global; | |
| $sm-lower-bound: 576px !global; | |
| $sm-upper-bound: 767px !global; | |
| $md-lower-bound: 768px !global; | |
| $md-upper-bound: 991px !global; | |
| $lg-lower-bound: 992px !global; | |
| $lg-upper-bound: 1199px !global; |
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
| class BaseClass { | |
| constructor(name) { | |
| this.name = name; | |
| this.someFlag = true; | |
| } | |
| } | |
| function factory(name) { | |
| class ExtendedClass extends BaseClass { | |
| constructor() { |
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
| enum HttpStatusCodes { | |
| Ok = 200, | |
| Created = 201, | |
| Accepted = 202, | |
| NonAuthoritativeInformation = 203, | |
| NoContent = 204, | |
| ResetContent = 205, | |
| PartialContent = 206, | |
| MultiStatus = 207, | |
| AlreadyReported = 208, |