Skip to content

Instantly share code, notes, and snippets.

View martijnburgers's full-sized avatar

Martijn Burgers martijnburgers

View GitHub Profile
function martijn() {
alert('hall4');
}
#Requires -Version 6.0
<#
The MIT License (MIT)
Altered version of Jari Turkia's code
https://gist.github.com/HQJaTu/c5695626ba51c6194845fa60913e911b
Copyright (c) 2020 Martijn Burgers
@martijnburgers
martijnburgers / gist:da4b155b1a9b5fa954c02949fba751a2
Created July 25, 2018 09:23
Windows delete all branches except master
PS: git checkout master; git branch -D @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()})
CMD with C:\Program Files\Git\usr\bin in your path: git branch | grep -v "master" | xargs git branch -D
vagrant : INFO global: Vagrant version: 1.8.1
At line:1 char:1
+ vagrant reload dc01shsdir --debug 2>&1 >> 33333.dc01.log.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( INFO global: Vagrant version: 1.8.1:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
vagrant : INFO global: Vagrant version: 1.8.1
At line:1 char:1
+ vagrant reload web01 --debug 2>&1 >> blah.web01.log.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( INFO global: Vagrant version: 1.8.1:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
vagrant : INFO global: Vagrant version: 1.8.1
At line:1 char:1
+ vagrant reload web01 --debug 2>&1 >> web01.log1.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( INFO global: Vagrant version: 1.8.1:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
vagrant : INFO global: Vagrant version: 1.8.1
At line:1 char:1
+ vagrant reload dc01shsdir --debug 2>&1 >> new.mb.dc01.log1.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( INFO global: Vagrant version: 1.8.1:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
@martijnburgers
martijnburgers / AutofacAutoMapperModule2.1.267.cs
Created February 10, 2016 13:31
Our Autofac module for AutoMapper 2.1.267
public class AutoMapperModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder.RegisterType<ConfigurationStore>()
.As<ConfigurationStore>()
.WithParameter(new TypedParameter(typeof (IEnumerable<IObjectMapper>), MapperRegistry.AllMappers()))
.SingleInstance();
builder.Register(c => c.Resolve<ConfigurationStore>()).As<IConfigurationProvider>();
@martijnburgers
martijnburgers / FindConflictingReferences.cs
Created April 20, 2015 06:55
Very old code that I found back in some old repo.
public class UtilityTest
{
public void FindConflictingReferences()
{
var assemblies = GetAllAssemblies(@"PATH");
var references = GetReferencesFromAllAssemblies(assemblies);
var groupsOfConflicts = FindReferencesWithTheSameShortNameButDiffererntFullNames(references);
@martijnburgers
martijnburgers / SQL_CLR_Functions-NETCLR40.sql
Created April 13, 2015 20:07
SQL CLR Functions for converting bytes to UTF-7, UTF-8, UTF32 and Unicode. Build for SQL Server 2012 and 2014.
GO
PRINT N'Creating [SQL_CLR_Functions]...for SQL Server 2012 and 2014.';
GO
CREATE ASSEMBLY [SQL_CLR_Functions]
AUTHORIZATION [dbo]
FROM 0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C01030041212C550000000000000000E00002210B010B000008000000060000000000002E270000002000000040000000000010002000000002000004000000000000000400000000000000008000000002000000000000030040850000100000100000000010000010000000000000100000000000000000000000D42600005700000000400000C802000000000000000000000000000000000000006000000C0000009C2500001C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000080000000000000000000000082000004800000000000000000000002E7465787400000034070000002000000008000000020000000000000000000000000000200000602E72737263000000C8020000004000000004000000