Skip to content

Instantly share code, notes, and snippets.

View camilohe's full-sized avatar

Camilo E. Hidalgo Estevez camilohe

View GitHub Profile
@camilohe
camilohe / DmpAnalysis.linq
Created December 31, 2018 18:18 — forked from NickCraver/DmpAnalysis.linq
DMP Analysis in LinqPad
<Query Kind="Program">
<NuGetReference Prerelease="true">Microsoft.Diagnostics.Runtime</NuGetReference>
<Namespace>Microsoft.Diagnostics.Runtime</Namespace>
<Namespace>System</Namespace>
<Namespace>System.IO</Namespace>
<Namespace>System.Linq</Namespace>
<Namespace>System.Text</Namespace>
<Namespace>Microsoft.Diagnostics.Runtime.Utilities</Namespace>
</Query>
@camilohe
camilohe / DownloadBuildArtifacts.ps1
Created October 1, 2018 13:43 — forked from DanijelMalik/DownloadBuildArtifacts.ps1
Download build artifacts in VSTS Release
param(
[Parameter(Mandatory = $true)]
[string] $AccountName
)
# System variables
$projectId = $env:SYSTEM_TEAMPROJECTID
$releaseId = $env:RELEASE_RELEASEID
$artifactsDir = $env:SYSTEM_ARTIFACTSDIRECTORY
$token = $env:SYSTEM_ACCESSTOKEN
@camilohe
camilohe / type-dependency-graph.fsx
Created July 26, 2018 20:55 — forked from swlaschin/type-dependency-graph.fsx
This script analyzes the dependencies between top level types in a .NET Assembly. It is then used to compare the dependency relationships in some F# projects with those in some C# projects.
(*
This script analyzes the dependencies between top level types in a .NET Assembly.
It is then used to compare the dependency relationships in some F# projects with those in some C# projects.
Note that no attempt has been made to optimize the code yet!
REQUIRES:
* Mono.Cecil for code analysis
From http://www.mono-project.com/Cecil#Download
#r @"packages\Streams.0.2.5\lib\Streams.Core.dll"
open System
open System.IO
open System.Collections.Generic
open Nessos.Streams
// make Visual Studio use the script directory
Directory.SetCurrentDirectory(__SOURCE_DIRECTORY__)
@camilohe
camilohe / disable-fusion-log.ps1
Created June 27, 2018 14:42 — forked from teamaton/disable-fusion-log.ps1
FusionLog - enable and disable
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name ForceLog
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogFailures
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogResourceBinds
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogPath
private static readonly char[] CharsThatRequireQuoting = { ' ', '"' };
private static readonly char[] CharsThatRequireEscaping = { '\\', '"' };
/// <summary>
/// Escapes arbitrary values so that the process receives the exact string you intend and injection is impossible.
/// Spec: https://msdn.microsoft.com/en-us/library/bb776391.aspx
/// </summary>
public static string EscapeProcessArgument(string literalValue, bool alwaysQuote = false)
{
if (string.IsNullOrEmpty(literalValue)) return "\"\"";
@camilohe
camilohe / FindConflictingReferences.cs
Created September 6, 2017 13:53 — forked from brianlow/FindConflictingReferences.cs
Find conflicting assembly references
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
namespace MyProject
{
[TestFixture]
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Reflection;
namespace FindConflictingReference
{
public class Reference
{
public AssemblyName Assembly { get; set; }
@camilohe
camilohe / Enable-wttr.in-for-PowerShell
Created May 31, 2017 21:25 — forked from chubin/Enable-wttr.in-for-PowerShell
How to enable wttr.in in a PowerShell console
# To enable ANSI sequences in a PowerShell console run the following commands.
# After that you can use wttr.in in you PowerShell just lake that:
# (curl http://wttr.in/ -UserAgent "curl" ).Content
#
# More on it:
# http://stknohg.hatenablog.jp/entry/2016/02/22/195644 (jp)
#
Add-Type -MemberDefinition @"
[DllImport("kernel32.dll", SetLastError=true)]
@camilohe
camilohe / gitconfig.ini
Created April 20, 2017 16:50 — forked from tdd/gitconfig.ini
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = your@email.tld
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
st = status