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
| getService(): void { | |
| const id = parseInt(this._route.snapshot.params['id']); | |
| if (id && id > 0) { | |
| this.indLoading = true; | |
| this._restService.getById('/api/serviceapi/, id).subscribe( | |
| resp => { | |
| // get form array reference | |
| const staffs = this.serviceFrm.get('Staffs') as FormArray; | |
| // empty form array | |
| while (staffs.length) { |
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 { BrowserModule, DomSanitizer } from '@angular/platform-browser'; | |
| @Component({ | |
| selector: 'my-app', | |
| template: ` | |
| <div [innerHtml]="html"></div> | |
| `, | |
| }) | |
| export class App { | |
| constructor(private sanitizer: DomSanitizer) { |
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 class ValidationMessageDirective implements AfterViewInit, OnDestroy { | |
| private validationMessageComponent: ComponentRef<ValidationMessageComponent> = null; | |
| ngAfterViewInit(): void { | |
| let factory = this.componentFactoryResolver.resolveComponentFactory(this.vmComp); | |
| this.ngOnDestroy(); | |
| this.validationMessageComponent = this.viewContainer.createComponent(factory, null, this.viewContainer.injector); | |
| this.validationMessageComponent.changeDetectorRef.detectChanges(); | |
| } |
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
| if ($(document).height() > $(window).height()) { | |
| $([document.documentElement, document.body]).animate({ | |
| scrollTop: $("#certificate-info h2").offset().top | |
| }, 2000); | |
| } |
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
| " Tabulation highlights syntax | |
| set tabstop=2 | |
| set shiftwidth=2 | |
| set smarttab | |
| set expandtab " Copy current line tabs to new line | |
| set smartindent " ...like a expandtab but it adding {} tabs | |
| " ========================= Short keys settings" ============================== | |
| " NERDTree | |
| map <silent> <C-b> :NERDTreeToggle<CR> " NERDTree toggle |
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
| # mysql -u root -p | |
| CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'some_very_complex_password'; | |
| GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; | |
| FLUSH PRIVILEGES; |
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
| n=$(which node); \ | |
| n=${n%/bin/node}; \ | |
| chmod -R 755 $n/bin/*; \ | |
| sudo cp -r $n/{bin,lib,share} /usr/local |
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
| 'use strict'; | |
| var os = require('os'); | |
| var ifaces = os.networkInterfaces(); | |
| module.exports = () => { | |
| const result = []; | |
| Object.keys(ifaces).forEach(function (ifname) { | |
| var alias = 0; |
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
| choco install --yes robo3t |
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
| const path = require('path'); | |
| const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); | |
| module.exports = { | |
| paths: function (paths, env) { | |
| paths.appIndexJs = path.resolve(__dirname, 'src/frontend/index.js'); | |
| paths.appSrc = path.resolve(__dirname, 'src/frontend'); | |
| return paths; | |
| }, |