This file contains 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 class AppModule { | |
constructor(private router: Router, private viewportScroller: ViewportScroller) { | |
// Disable automatic scroll restoration to avoid race conditions | |
this.viewportScroller.setHistoryScrollRestoration('manual'); | |
this.handleScrollOnNavigation(); | |
} | |
/** | |
* When route is changed, Angular interprets a simple query params change as "forward navigation" too. |
This file contains 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 { ActivatedRoute, NavigationEnd, Router, RouterEvent, RouterLinkWithHref, UrlTree } from '@angular/router'; | |
import { | |
Directive, | |
EventEmitter, | |
HostBinding, | |
HostListener, | |
Input, | |
isDevMode, | |
OnChanges, | |
OnDestroy, |
This file contains 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
// based on Алексей Сердюков's answer at Stackoverflow (https://stackoverflow.com/a/50837219/1143392) | |
import { | |
Directive, | |
Input, | |
OnDestroy, | |
OnInit | |
} from '@angular/core'; | |
import { MediaObserver } from '@angular/flex-layout'; | |
import { MatGridList } from '@angular/material'; |
This file contains 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
#!/bin/sh | |
####################################################### | |
# | |
# Edits the proxmox Subscription file to make it | |
# think that it has a Subscription. | |
# | |
# Will disable the annoying login message about | |
# missing subscription. | |
# |
Here's a curated list of interesting and useful Python packages. You can install any package with pip
by saying pip install <package-name>
. All of the packages on the list are open source.
This list has been collected spesifically for Anders Python Workshop evening. For more comprehensive list of interesting Python packages, take a look at https://github.com/vinta/awesome-python and for all 130k+ packages, search PyPI at https://pypi.org/
- faker - A package for generating fake data (for example testing purposes)
This file contains 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
# Author: Zameer Ansari | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# http://wiki.nginx.org/Pitfalls | |
# http://wiki.nginx.org/QuickStart | |
# http://wiki.nginx.org/Configuration | |
# | |
# Generally, you will want to move this file somewhere, and start with a clean | |
# file but keep this around for reference. Or just disable in sites-enabled. | |
# |
This file contains 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
package demo; | |
import java.io.Serializable; | |
import java.security.Principal; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.UUID; |
This file contains 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
// remove utf-8 BOM from ressource "res" | |
// res.charCodeAt(0) === 0xFEFF | res.charCodeAt(0) === 65279 | |
if (res.charCodeAt(0) === 0xFEFF) { | |
res = res.substr(1); | |
} |
NewerOlder