Skip to content

Instantly share code, notes, and snippets.

View madd0's full-sized avatar

Mauricio Díaz Orlich madd0

View GitHub Profile
@madd0
madd0 / msbuild-get-date.proj
Created June 7, 2018 10:19 — forked from sayedihashimi/msbuild-get-date.proj
MSBuild how to get a good formatted date
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
DefaultTargets="Demo" >
<Target Name="Demo">
<PropertyGroup>
<CurrentDate>$([System.DateTime]::Now.ToString(yyyyMMdd-mmss))</CurrentDate>
</PropertyGroup>

Keybase proof

I hereby claim:

  • I am madd0 on github.
  • I am madd0 (https://keybase.io/madd0) on keybase.
  • I have a public key ASAxL9uKy0Yywt-vSKzucHFvIn7MlzA6UprY6zBEj5fFDgo

To claim this, I am signing this object:

@madd0
madd0 / profile.ps1
Created March 24, 2020 08:58
A PowerShell function to easily navigate to a folder within a $BaseDir from anywhere using a dynamic parameter for tab completion. I use it to jump to repos in my `c:\sources` directory.
$BaseDir = "C:\sources"
Function go {
[CmdletBinding()]
param ()
DynamicParam {
# Set the dynamic parameters' name
$ParameterName = 'Repo'
# Create the dictionary
@madd0
madd0 / kusto-null-bins
Created April 21, 2020 13:45
Add "empty" bins to a kusto query
let Start=startofday(ago(2d));
let Stop=startofday(ago(1d));
requests
| where timestamp >= Start and timestamp < Stop
| summarize Count=count() by bin(timestamp, 1h)
| union (
range x from 1 to 1 step 1
| mv-expand timestamp=range(Start, Stop, 1h) to typeof(datetime)
| extend Count = 0
)