Skip to content

Instantly share code, notes, and snippets.

@hmemcpy
hmemcpy / gist:9447256
Last active August 29, 2015 13:57
Why do u crash?????
<entry>
<record>10589</record>
<time>2014/03/09 11:56:50.360</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.InvalidOperationException: Attempting to get the view from an adapter in state Closed
at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.get_WpfTextViewHost()
at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.ClearCommandContext()
at Microsoft.VisualStudio.Editor.Implementation.VsMouseProcessor.PostprocessMouseLeftButtonUp(MouseButtonEventArgs e)
at Microsoft.VisualStudio.Text.Utilities.WpfMouseProcessor.&lt;&gt;c__DisplayClass30.&lt;UIElement_MouseLeftButtonUp&gt;b__29()
This file has been truncated, but you can view the full file.
TearDown : JetBrains.Util.Tests.TestLoggerListener+TestWrapperException : 124 exceptions were thrown.
#001: Component CatalogType: JetBrains.ProjectModel.SolutionActivityTrackingComponent [Singleton, Corrupted] construction has failed. Exception has been thrown by the target of an invocation. Sequence contains more than one element
--- EXCEPTION #1/4 [InvalidOperationException]
Message = “Sequence contains more than one element”
ExceptionPath = Root.InnerException.InnerException.InnerException
ClassName = System.InvalidOperationException
Data.DescriptorType = “JetBrains.Application.Extensibility.PartComponentDescriptor, JetBrains.Platform.ReSharper.ComponentModel, Version=8.2.0.2151, Culture=neutral, PublicKeyToken=1010a0d8d6380325”
Data.State = Null
HResult = COR_E_INVALIDOPERATION=80131509
@hmemcpy
hmemcpy / gist:9f47ae12d88b4ab38439
Last active August 29, 2015 14:06
ATDD style tests with BDDfy!
private const string program = @"
/* 1 */ class Person
/* 2 */ {
/* 3 */ public int _age = 22;
/* 4 */ public int Age { get { return _age; } set { _age = value; } }
public override string ToString() { return ""hi""; }
/* 5 */ }
/* 6 */
/* 7 */ class Program
/* 8 */ {
@hmemcpy
hmemcpy / my-boxstarter.ps1
Last active August 29, 2015 14:08
Boxstarter script for my development machine
#development
cinst notepad2
cinst git.install
cinst poshgit
cinst jump-location
cinst beyondcompare
cinst devbox-rapidee
cinst envycoder
cinst nuget.commandline
cinst scriptcs
@hmemcpy
hmemcpy / Export-SvnDiff.ps1
Created December 16, 2014 11:29
Export-SvnDiff
function Export-SvnDiff($repo, $fromRevision, $toRevision, $outputDirectory)
{
$xpath = "/diff/paths/path[@kind='file' and (@item='added' or @item='modified')]"
[xml]$output = & svn diff -r $("{0}:{1}" -f $fromRevision, $toRevision) $repo --summarize --xml
$output | Select-Xml -XPath $xpath | % { $_.node."#text" } | % {
$targetFile = Resolve-FullPath (Join-Path $outputDirectory ($_ -replace $repo))
$targetDir = $targetFile | Split-Path
New-Item -Force -ItemType directory -Path $targetDir | Out-Null
& svn export -r $toRevision -q --force $_ $targetFile
@hmemcpy
hmemcpy / keybase.md
Created May 27, 2015 09:13
Keybase.io

Keybase proof

I hereby claim:

  • I am hmemcpy on github.
  • I am hmemcpy (https://keybase.io/hmemcpy) on keybase.
  • I have a public key whose fingerprint is 84D6 40BB 0374 D721 2744 9731 45E3 7E44 9CA7 AA0D

To claim this, I am signing this object:

@hmemcpy
hmemcpy / XD.md
Last active August 29, 2015 14:27

What am I doing wrong here?

var ns = XNamespace.Xmlns + "guid";
var doc = new XDocument(
	new XElement("root",
		new XAttribute(ns, "Guid"),
		new XElement(ns + "MyValue", "{4258b6f1-2c60-4723-8d99-a458d05104b6}")));

// doc.ToString() throws an exception: Prefix "xmlns" is reserved for use by XML.

@hmemcpy
hmemcpy / R# plugins
Created August 20, 2015 06:35
ReShaper plugins I'm using
CitizenMatt PreviewTab build 1.2.0 on 2015-08-07 09:38:44Z.
ConfigureAwaitChecker v9 build 0.4.0.1 on 2015-08-07 09:38:44Z.
EtherealCode ReSpeller build 4.1.9.0 on 2015-08-07 09:38:44Z.
EtherealCode ReSpellerPro build 4.1.9.0 on 2015-08-07 09:38:44Z.
JetBrains Mnemonics build 1.1.1 on 2015-08-07 09:38:44Z.
JLebosquain EnhancedTooltip build 2.3.1 on 2015-08-07 09:38:44Z.
JoarOyen ReSharper.LiveTemplates build 2.0.1.0 on 2015-08-07 09:38:44Z.
ReSharper AgentMulder build 1.2.0 on 2015-08-07 09:38:44Z.
ReSharper HeapView.R90 build 0.9.7 on 2015-08-07 09:38:44Z.
ReSharper Postfix.R90 build 2.1.1 on 2015-08-07 09:38:44Z.
@hmemcpy
hmemcpy / PublishingContextExtensions.cs
Created April 23, 2011 14:38
Updating the blog contents from within PublishNotificationHook
// based on an old blog post in Japanese: http://blog.sharplab.net/computer/cprograming/windowslivewriter/433/
// The field was moved to a base type in the latest version of Live Writer
using System.Reflection;
using WindowsLive.Writer.Api;
using WindowsLive.Writer.Extensibility.BlogClient;
using WindowsLive.Writer.PostEditor;
namespace WindowsLiveWriterPlugin.Extensions
{
Buildfile: file:///D:/code/Tao/Tao.build
Target framework: Microsoft .NET Framework 3.5
Target(s) specified: test
compile-interfaces:
[csc] Compiling 4 files to 'D:\code\Tao\build\net-2.0\Tao.Interfaces.dll'.
[csc] d:\code\Tao\src\Tao.Interfaces\IFunction.cs(8,32): error CS1031: Type expected
[csc] d:\code\Tao\src\Tao.Interfaces\IFunction.cs(8,32): error CS1519: Invalid token 'in' in class, struct, or int