Skip to content

Instantly share code, notes, and snippets.

View kzu's full-sized avatar

Daniel Cazzulino kzu

View GitHub Profile
@kzu
kzu / GuidUtils.cs
Created August 2, 2010 02:26
Provides an easy way to create sequential guids
using System;
using System.Runtime.InteropServices;
using System.Security;
public static class GuidUtil
{
[SuppressUnmanagedCodeSecurity]
[DllImport("rpcrt4.dll", SetLastError = true)]
private static extern int UuidCreateSequential(out Guid value);
@kzu
kzu / mtvs-setup
Created September 4, 2012 22:59
Missing files for setup
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(155,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\MonoTouch.Dialog-1.dll'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(156,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\MonoTouch.Dialog-1.dll.mdb'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(157,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\monotouch.dll'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(158,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\monotouch.dll.mdb'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(159,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\MonoTouch.NUnitLite.dll'.
D:\Code\Xamarin\AndroidVS\Setup\MonoTouch\Product.wxs(160,0): error LGHT0103: The system cannot find the file '..\..\Mono.IOS.VisualStudio\lib\MonoTouch.NUnitLite.dll.mdb'.
D:\Code\Xamarin\Andr
@kzu
kzu / gist:3708340
Created September 12, 2012 17:22
Failed resource generation task
After hardcoding a fix to the GenerateResourceDesigner in the targets file with:
<GenerateResourceDesigner
IsApplication="true"
NetResgenOutputFile="$(ResgenTemporaryDirectory)\$(AndroidResgenFilename)"
JavaResgenInputFile="$(_GeneratedPrimaryJavaResgenFile)"
Namespace="$(AndroidResgenNamespace)"
Resources="@(_AndroidResourceDest)"
ResourceDirectory="$(MonoAndroidResDirIntermediate)"
/>
//***************************************************************************
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// This code is licensed under the Visual Studio SDK license terms.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//***************************************************************************
@kzu
kzu / StackEditTest
Last active December 23, 2015 19:09
Welcome document
Welcome to StackEdit! {#welcome}
=====================
Some change here.
What if changed again?
Hello, I am your first Markdown document within **StackEdit**[^stackedit]. Don't delete me, I can be helpful. I can be recovered anyway in the `Utils` tab of the <i class="icon-cog"></i> `Settings` dialog.
----------
@kzu
kzu / Class1.cs
Last active August 28, 2018 07:22
Generates class files from a text file and makes intellisense work
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DynamicIntellisense
{
public class Class1
{
@kzu
kzu / gist:11154155
Created April 21, 2014 19:47
templates reference
<ProjectReference Include="..\Xamarin.QuickUI\Xamarin.QuickUI.VSTemplate\Xamarin.QuickUI.VSTemplate.csproj">
<Project>{57f94175-2001-4088-accf-f2fbdcb95638}</Project>
<Name>Xamarin.QuickUI.VSTemplate</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bPkgdefProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
@kzu
kzu / Checkout
Created May 8, 2014 18:55
VsHelper.Checkout
/// <summary>
/// Checks-out the file from source control.
/// </summary>
public static void CheckOut(string fileName)
{
Guard.NotNullOrEmpty(() => fileName, fileName);
if (File.Exists(fileName))
{
var vs = ServiceProvider.GlobalProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
@kzu
kzu / fact.snippet
Last active July 5, 2016 19:24
Code snippet for creating BDD-style xUnit tests
<?xml version="1.0" encoding="utf-8" ?>
<!-- Download to %userprofile%\Documents\Visual Studio [2010|2012|2013|vNext]\Code Snippets\Visual C#\My Code Snippets -->
<!--
Template for xunit test methods
Press fact[tab][tab] to get it.
-->
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>XUnit test</Title>
@kzu
kzu / CustomJsonNet
Created May 21, 2014 16:36
Json.NET Extensibility Example
namespace JsonExtensibility
{
public class JsonTests
{
[Fact]
public void when_serializing_itask_then_can_customize_properties ()
{
var serializer = new JsonSerializer {
Formatting = Formatting.Indented,
};