Skip to content

Instantly share code, notes, and snippets.

@davidsk
davidsk / GitMoveFolderPath.ps1
Last active March 15, 2022 08:57
Script to move a folder structure using git mv
# find all files
Get-ChildItem -Recurse -File | % {
$sourceDirectory = Split-Path -Path $_.FullName -Parent;
$sourceFileName = Split-Path -Path $_.FullName -Leaf;
# $sourceDirectory;
# $sourceFileName;
# replace old path with new path
$targetDirectory = $sourceDirectory.Replace("Areas\Application\Views", "Modules\Pages");
  • Enable Windows Sandbox
  • Enable WSL
  • Update Linux kernel
  • Install Windows Package Manager
  • Install Windows Terminal
  • Windows Terminal Powerline
  • Oh My Posh
  • Install Cascadia Powerline Fonts
  • Install Microsoft PowerToys
  • Install Microsoft Visual Studio Code
@davidsk
davidsk / fix-package-path.wpp.targets
Created October 4, 2020 13:48 — forked from sayedihashimi/fix-package-path.wpp.targets
MSBuild wpp.targets file to fix the long path in web packages from Visual Studio
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PackagePath Condition=" '$(PackagePath)'=='' ">website</PackagePath>
<EnableAddReplaceToUpdatePacakgePath Condition=" '$(EnableAddReplaceToUpdatePacakgePath)'=='' ">true</EnableAddReplaceToUpdatePacakgePath>
<PackageDependsOn>
$(PackageDependsOn);
AddReplaceRuleForAppPath;
</PackageDependsOn>
@davidsk
davidsk / kdds-hub.html
Last active July 23, 2020 12:02
azure-devops-extension-sdk error
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- <script src="node_modules/requirejs/require.js"></script> -->
<script src="kdds-hub.js"></script>
</head>
<body>
<h1>Hello, <span id="name"></span></h1>
</body>
</html>
@davidsk
davidsk / Find-GitRepository.ps1
Created July 12, 2020 12:03 — forked from jdhitsolutions/Find-GitRepository.ps1
Use this PowerShell function to find Git repositories in the specified folder. It is assumed that you have the Git command line tools already installed.
Function Find-GitRepository {
<#
.SYNOPSIS
Find Git repositories
.DESCRIPTION
Use this command to find Git repositories in the specified folder. It is assumed that you have the Git command line tools already installed.
.PARAMETER Path
The top level path to search.
@davidsk
davidsk / update-database.ps1
Created October 7, 2019 18:56
Synchronise EF Core Database with Code
param (
[Parameter(Mandatory=$true)][string]$project
[Parameter(Mandatory=$true)][string]$context
[string]$startupProject
)
Set-Location $PSScriptRoot
if (-Not ($startupProject))
{
// constructor function
function Foo(){
//public
this.name = "Bob";
// private
var self = this, // <-- assign 'this' within constructor to private variable to allow private methods access to the object members
x = 6;
@davidsk
davidsk / WeekOfDay Count Calculator.js
Last active September 20, 2016 12:56
WeekOfDay Count Calculator created by davidsk - https://repl.it/DFqJ/25
var DayOfWeek = {
Sunday: 0,
Monday: 1,
Tuesday: 2,
Wednesday: 3,
Thursday: 4,
Friday: 5,
Saturday: 6
};