Skip to content

Instantly share code, notes, and snippets.


Sayed Ibrahim Hashimi sayedihashimi

View GitHub Profile
sayedihashimi / Get-CurrentBranch.ps1
Created Jul 16, 2020
Get-CurrentBranch powershell function
View Get-CurrentBranch.ps1
function Get-CurrentBranch{
[string]$result = &git branch --show-current
if(-not $result){
$result = $result.trim();

Add the target below to the project file for your dotnet core global tool. You can run this target to simplify reinstalling the global tool. You can execute this target with dotnet build -t:InstallTool.

When this target is executed the following will happen (in this order):

  • Project is packed into a NuGet package
  • Tool is uninstalled with dotnet tool uninstall
  • Tool is installed with dotnet tool install
  • Help is called on the tool just installed
View snippet for juan
<!-- Don't publish the SPA source files, but do show them in the project files list -->
<Content Remove="$(SpaRoot)**" />
<!-- remove duplicate .json files from Content -->
<Content Remove="appsettings.json;appsettings.Development.json;bundleconfig.json" />
<Content Include="appsettings.json" Condition="Exists('appsettings.json')" />
<Content Include="appsettings.Development.json" Condition="Exists('appsettings.Development.json')" />
<Content Include="bundleconfig.json" Condition="Exists('bundleconfig.json')" />
<!-- remove .ts files from None, they should be in TypeScriptCompile instead -->
<None Remove="**/*.ts" />
sayedihashimi / extract-interface.gif
Last active Nov 8, 2018
Some sample Quick Fix actions available in Visual Studio for Mac
sayedihashimi /
Last active Jul 6, 2018
how to limit nuget packages and versions to specific ones

Question: How can I ensure that all projects only use a specific set of nuget packages and versions? I'm using VS2017.

The way that I would handle this is to add a ([] to help in this scenario.

The idea is that you will add an msbuild .targets file in the source root named In that file you can inject a target to be run before the build starts. For example,

sayedihashimi /
Last active Jun 25, 2018
How to publish a web project to multiple IIS sites


  • I have a web project that I want to publish to multiple IIS sites
  • Publish in VS should publish to devs local IIS server (MSDeploy)
  • Publish from CI/CLI should publish to remote env (MSDeploy)
  • CI/CLI and VS publish should be the same
  • Building the solution takes ~3 min and should only be performed once
  • Config files need to be transformed based on the dest env


How can I accomplish this?

sayedihashimi / dotnet-new-templates.txt
Last active Jul 24, 2017
Templates availabe on for dotnet new
View dotnet-new-templates.txt
--- template report ---
Name DownloadCount Percent overall
---- ------------- ---------------
Microsoft.AspNetCore.SpaTemplates 44876 65.4 %
Microsoft.DotNet.Web.Spa.ProjectTemplates 6253 9.1 %
libyear 1860 2.7 %
Boilerplate.Templates 1600 2.3 %
IdentityServer4.Templates 1136 1.7 %
Amazon.Lambda.Templates 1122 1.6 %
sayedihashimi / dotnet-new-ux.ps1
Last active Mar 1, 2018
dotnet new user interaction
View dotnet-new-ux.ps1
# to run this script:
# (new-object Net.WebClient).DownloadString("") | iex
function StartDefault{
View machine-setup.ps1
$global:machinesetupconfig = @{
MachineSetupConfigFolder = (Join-Path $env:temp 'SayedHaMachineSetup')
MachineSetupAppsFolder = (Join-Path $env:temp 'SayedHaMachineSetup\apps')
BaseChocoPackages = @(
sayedihashimi / download-tablebases
Created Sep 18, 2016
Download Nalimov table bases (3/4/5)
View download-tablebases
function DownloadTablebases{
$baseUrl = '',
$allFilename = 'all.txt',
$downloadRoot = ($pwd)
You can’t perform that action at this time.