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
var solutionDir = Directory.GetParent(env.ContentRootPath).FullName; | |
spa.Options.SourcePath = Path.Join(solutionDir, "ICollect.Public.ClientApp"); | |
spa.UseAngularCliServer("start"); |
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 { Injectable } from '@angular/core'; | |
import { NativeDateAdapter } from '@angular/material'; | |
import { format as formatFns } from 'date-fns'; | |
// https://github.com/angular/components/blob/9eeb4b5aa0473c0815a73bfe3c2ed6164d86a3b3/src/material/core/datetime/native-date-formats.ts | |
// https://github.com/angular/components/blob/fde980c8ad57a803c7bf6ca0d909cedccc354f06/src/material/core/datetime/native-date-adapter.ts | |
export const MAT_CUSTOM_DATE_FORMATS = { | |
parse: { | |
dateInput: 'yyyy-MM-dd', | |
}, |
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 { Injectable } from '@angular/core'; | |
import { DateAdapter } from '@angular/material'; | |
import { addDays, addMonths, addYears, getDate, getDaysInMonth, getMonth, getYear } from 'date-fns'; | |
import { format, parse, setDay, setMonth, toDate, Locale } from 'date-fns'; | |
import { enUS } from 'date-fns/locale'; | |
export const MAT_DATE_FNS_DATE_FORMATS = { | |
parse: { | |
dateInput: 'yyyy-MM-dd', | |
}, |
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
https://stackblitz.com/edit/ngx-formly-flex-layout | |
https://stackblitz.com/edit/ngx-formly-flex-layout-ntx9fe |
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
<form [formGroup]="form"> | |
<formly-form [model]="model" [fields]="fields" [form]="form"></formly-form> | |
</form> | |
<pre>{{model | json}}</pre> | |
<pre>invalid: {{form.invalid}}</pre> | |
<pre>errors: {{form.errors | json}}</pre> |
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 { TestBed } from '@angular/core/testing'; | |
import { AllocationRoutingService } from './allocation-routing.service'; | |
describe('AllocationRoutingService', () => { | |
beforeEach(() => TestBed.configureTestingModule({})); | |
it('should be created', () => { | |
const service: AllocationRoutingService = TestBed.get(AllocationRoutingService); | |
expect(service).toBeTruthy(); |
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
private void ValidationConfiguration() | |
{ | |
var fields = this.Fields.Select(x => x.Key).ToList(); | |
var duplicateFields = fields.GroupBy(x => x) | |
.Where(g => g.Count() > 1) | |
.Select(y => y.Key) | |
.ToList(); | |
if (duplicateFields.Count > 0) | |
{ | |
var result = string.Join(',', duplicateFields); |
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
mkdir -p ~/Documents/WindowsPowerShell | |
New-Item -Type file ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 | |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco feature enable --name=allowGlobalConfirmation | |
choco install googlechrome | |
choco install 7zip | |
choco install adobereader |
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
# set strong cryptography on 64 bit .Net Framework (version 4 and above) | |
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord | |
# set strong cryptography on 32 bit .Net Framework (version 4 and above) | |
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord |
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
$dirName=[System.IO.Path]::GetDirectoryName($profile) | |
if(!(Test-Path $dirName)) | |
{ | |
Write-Host "creating profile directory: $dirName" | |
New-Item -ItemType directory -Path $dirName | |
} | |
if (!(Test-Path $profile)) | |
{ |
NewerOlder