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
<Project> | |
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> | |
<PropertyGroup> | |
<TargetFramework>netstandard2.0</TargetFramework> | |
<RootNamespace>Project_with_manual_Import</RootNamespace> | |
</PropertyGroup> | |
<ItemGroup> |
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://gist.github.com/ap0llo/9d7cab3a4d05bb3b43720d2997c03d9f | |
function Set-LocationToRepository([Parameter(Mandatory = $false)][string]$Name) { | |
if (-not $RepositoriesDirectory) { | |
$RepositoriesDirectory = Join-Path $env:USERPROFILE "source\repos" | |
} | |
if (-not (Test-Path -Path $RepositoriesDirectory -PathType Container)) { | |
throw "Repositories directory '$RepositoriesDirectory' does not exist." |
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://gist.github.com/ap0llo/89f968508ccf1d9993393ffa0ce37f88 | |
function Open-GitHub([string]$Path) { | |
if (($null -eq $Path) -or ($Path -eq "")) { | |
$Path = (Get-Location).Path | |
} | |
$Path = (Resolve-Path $Path -ErrorAction Stop).Path | |
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://gist.github.com/ap0llo/4e3b173afe6ca23299add223396de165 | |
function Open-SolutionFile([string]$Name) { | |
if (($null -ne $Name) -and ($Name -ne "")) { | |
$slnFiles = Get-ChildItem -File *.sln -Recurse | Where-Object { $_.Name -like "*$Name*" } | |
} else { | |
$slnFiles = Get-ChildItem -File *.sln -Recurse | |
} |
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
# Powershell script to export charts from excel to jpg | |
function Export-Chart($inputFile, $sheetName, $chartIndex, $outputFile) | |
{ | |
# Load Powerpoint Interop Assembly | |
[Reflection.Assembly]::LoadWithPartialname("Microsoft.Office.Interop.Excel") > $null | |
[Reflection.Assembly]::LoadWithPartialname("Office") > $null | |
$msoFalse = [Microsoft.Office.Core.MsoTristate]::msoFalse | |
$msoTrue = [Microsoft.Office.Core.MsoTristate]::msoTrue |
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
# Powershell script to export Powerpoint slides as jpg images using the Powerpoint COM API | |
function Export-Slide($inputFile, $slideNumber, $outputFile) | |
{ | |
# Load Powerpoint Interop Assembly | |
[Reflection.Assembly]::LoadWithPartialname("Microsoft.Office.Interop.Powerpoint") > $null | |
[Reflection.Assembly]::LoadWithPartialname("Office") > $null | |
$msoFalse = [Microsoft.Office.Core.MsoTristate]::msoFalse | |
$msoTrue = [Microsoft.Office.Core.MsoTristate]::msoTrue |
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
# Powershell script to export tables from excel to LaTeX markup | |
function ConvertTo-Latex($inputFile, $sheetName, $startX, $startY, $endX, $endY, $outputFile) | |
{ | |
function Get-LatexTableOptions($columnCount) | |
{ | |
$options = "|" | |
for($i = 0; $i -lt $columnCount; $i = $i + 1) |
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
# Powershell script to export Powerpoint Presentations to pdf using the Powerpoint COM API | |
# Based on a VB script with the same purpose | |
# http://superuser.com/questions/641471/how-can-i-automatically-convert-powerpoint-to-pdf | |
function Export-Presentation($inputFile) | |
{ | |
# Load Powerpoint Interop Assembly | |
[Reflection.Assembly]::LoadWithPartialname("Microsoft.Office.Interop.Powerpoint") > $null | |
[Reflection.Assembly]::LoadWithPartialname("Office") > $null |
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
# Powershell script that exports visio drawings to png | |
# Based on a F# script with the same purpose which can be found at | |
# http://stackoverflow.com/questions/1145269/visio-to-image-command-line-conversion | |
$outputFormat = ".png" | |
$inputFilePattern = "*.vsdx" | |
# Load Visio Interop Assembly | |
[Reflection.Assembly]::LoadWithPartialname("Microsoft.Office.Interop.Visio") > $null |
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
using System; | |
using System.Windows.Input; | |
namespace Snippet | |
{ | |
public class RelayCommand : ICommand | |
{ | |
readonly Action<object> m_Execute; | |
readonly Func<object, bool> m_CanExecute; |
NewerOlder