Skip to content

Instantly share code, notes, and snippets.


David De Sloovere DavidDeSloovere

View GitHub Profile
DavidDeSloovere / fetch.ps1
Created Sep 29, 2020
git fetch over all subfolders with PowerShell
View fetch.ps1
gci | foreach { write-host $_.fullname; push-location $_; & git fetch }
DavidDeSloovere / cards.yaml
Created Feb 8, 2020
Home Assistant automation for Magic Cards
View cards.yaml
- alias: Play Station from Magic Cards
- platform: event
event_type: magic_card_scanned
card_type: station
# - service: notify.group_deef
# data_template:
# title: "Magic Cards {{ }}"
DavidDeSloovere /
Last active Mar 2, 2018
Make PowerShell prettier and display Git status

Install Scoop A command-line installer for Windows

iex (new-object net.webclient).downloadstring('')

Install concfg concfg is a utility to import and export Windows console settings like fonts and colors.

DavidDeSloovere / run.csx
Created Nov 17, 2016
View run.csx
// full repo at
public static async Task<object> Run(HttpRequestMessage req, TraceWriter log)
log.Info("Webhook was triggered!");
string jsonContent = await req.Content.ReadAsStringAsync();
dynamic data = JsonConvert.DeserializeObject(jsonContent);
DavidDeSloovere / upload.cs
Created Nov 17, 2016
SFTP upload with SSH.NET
View upload.cs
const string host = "";
const string username = "chucknorris";
const string password = "norrischuck";
const string workingdirectory = "/highway/hell";
const string uploadfile = @"c:\yourfilegoeshere.txt";
Console.WriteLine("Creating client and connecting");
using (var client = new SftpClient(host, port, username, password))
DavidDeSloovere / vsts-build-custom-var-creation.ps1
Last active Aug 13, 2018
Create a custom variable in VSTS build powershell task
View vsts-build-custom-var-creation.ps1
#output to stdout in special format
Write-Host ("##vso[task.setvariable variable=ThisIsMyVariable;]somevalue")
# reuse in subsequent tasks
DavidDeSloovere / _Layout.cshtml
Last active Nov 9, 2018
Config HTTP headers. Adds X-Content-Type-Options and remove X-Powered-By for every request and X-UA-Compatible for views.
View _Layout.cshtml
<!DOCTYPE html>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
DavidDeSloovere / dump-env-variables.ps1
Last active Feb 5, 2017
TEAM BUILD PowerShell: Output all documented environment variables
View dump-env-variables.ps1
# Team Foundation Build environment variables
Write-Host "TF_BUILD : $Env:TF_BUILD "
DavidDeSloovere / getversioninfo.cs
Last active Aug 29, 2015
Get the 3 versions that can be attached to an assembly via AssemblyInfo. Can be used in ASP.NET MVC to output the version in the footer.
View getversioninfo.cs
var assembly = Assembly.GetExecutingAssembly();
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
model.FileVersion = string.Format(CultureInfo.InvariantCulture, "v{0}", fvi.FileVersion);
model.ProductVersion = string.Format(CultureInfo.InvariantCulture, "v{0}", fvi.ProductVersion);
model.AssemblyVersion = string.Format(CultureInfo.InvariantCulture, "v{0}", assembly.GetName().Version);
DavidDeSloovere / web.config
Created Sep 3, 2014
Add caching for favicon in web.config
View web.config
<location path="favicon.ico">
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="90.00:00:00" />
You can’t perform that action at this time.