Skip to content

Instantly share code, notes, and snippets.

View StickNitro's full-sized avatar
🏠
Working from home

Neil Stevens StickNitro

🏠
Working from home
View GitHub Profile
@StickNitro
StickNitro / Utilities.cake
Created March 14, 2017 11:08 — forked from RichiCoder1/Utilities.cake
Copy Directory helper
public void CopyDirectory(string source, string destination)
{
// Get the subdirectories for the specified directory.
var dir = new DirectoryInfo(source);
var dirs = dir.GetDirectories();
if (!dir.Exists)
{
throw new DirectoryNotFoundException(
"Source directory does not exist or could not be found: "
@StickNitro
StickNitro / Utilities.Cake
Created March 14, 2017 11:22
Extended CopyDirectory to allow providing an array of sub-directories to ignore when copying
public void CopyDirectory(string source, string destination, string[] subdirsToIgnore)
{
// Get the subdirectories for the specified directory.
var dir = new DirectoryInfo(source);
var dirs = dir.GetDirectories();
if (!dir.Exists)
{
throw new DirectoryNotFoundException(
"Source directory does not exist or could not be found: "
@StickNitro
StickNitro / deepcopy
Last active July 17, 2018 12:22
deepcopy
export function deepcopy<T = {}>(obj: T): T {
return <T>JSON.parse(JSON.stringify(obj));
}
@StickNitro
StickNitro / user-list.component.html
Created November 1, 2018 11:59
mat-table-multi-select-column
<ng-container matColumnDef="select">
<mat-header-cell *matHeaderCellDef>
<mat-checkbox (change)="$event ? masterToggle() : null" [checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()"></mat-checkbox>
</mat-header-cell>
<mat-cell *matCellDef="let row">
<mat-checkbox [checked]="selection.isSelected(row)" (click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"></mat-checkbox>
</mat-cell>
</ng-container>
@StickNitro
StickNitro / template.html
Last active June 14, 2022 04:34
mat-table with no records found display
<mat-table class="mat-elevation-z8" [dataSource]="dataSource">
<!-- columns here -->
<ng-container matColumnDef="noData">
<mat-footer-cell *matFooterCellDef [attr.colspan]="displayedColumns.length">
No records found.
</mat-footer-cell>
</ng-container>