Skip to content

Instantly share code, notes, and snippets.

View nesteruk's full-sized avatar
🍸
retired

Dmitri Nesteruk nesteruk

🍸
retired
  • Mesa Funds
View GitHub Profile
@nesteruk
nesteruk / gist:1474476
Created December 13, 2011 23:35
Highlighting on 2nd line in every document
using System;
using System.Collections.Generic;
using System.Diagnostics;
using JetBrains.Annotations;
using JetBrains.Application.Progress;
using JetBrains.Application.Settings;
using JetBrains.DocumentModel;
using JetBrains.ReSharper.Daemon;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.CSharp;
@nesteruk
nesteruk / gist:1632784
Created January 18, 2012 12:30
Random list generation program (with comments :)
#include <iostream>
using namespace std;
struct list_item
{
list_item *next;
list_item *rand;
};
void deep_copy(list_item* src, list_item* &dst)
@nesteruk
nesteruk / gist:1632782
Created January 18, 2012 12:29
Random list duplication
#include <iostream>
using namespace std;
struct list_item
{
list_item *next;
list_item *rand;
};
void deep_copy(list_item* src, list_item* &dst)
@nesteruk
nesteruk / MixinContextAction
Created August 23, 2012 11:43
Mixin context action
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using ActiveMesa.R2P.ContextActions;
using ActiveMesa.R2P.Infrastructure;
using JetBrains.Application;
using JetBrains.Application.Progress;
using JetBrains.ProjectModel;
@nesteruk
nesteruk / ReadOnlyInterfaceGen.cs
Created November 6, 2012 10:49
Readonly interface generator
using System.Collections.Generic;
using System.Linq;
using JetBrains.ActionManagement;
using JetBrains.Annotations;
using JetBrains.Application.DataContext;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Feature.Services.CSharp.Generate;
using JetBrains.ReSharper.Feature.Services.Generate;
using JetBrains.ReSharper.Feature.Services.Generate.Actions;
using JetBrains.ReSharper.Psi;
a*x*x + b*x + c
@nesteruk
nesteruk / gist:4152824
Created November 27, 2012 06:57
Factoring context action
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JetBrains.ReSharper.Psi.CSharp.Tree;
namespace ActiveMesa.R2P.Maths.Factor
{
using System;
using JetBrains.Application.Progress;
using JetBrains.ProjectModel;
x*(a*x + b) + c
@nesteruk
nesteruk / gist:4970909
Last active December 13, 2015 20:38
Bindable CheckBoxElement
using System;
namespace ConsoleApplication1
{
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Annotations;
public class CheckBoxElement : INotifyPropertyChanged, IEquatable<CheckBoxElement>
@nesteruk
nesteruk / gist:4987154
Last active December 13, 2015 22:49
R# plugin class creation sample
private static class ReadOnlyIntefaceBuilderWorkflow
{
public static WorkflowResult Start([CanBeNull] CSharpGeneratorContext context, CSharpElementFactory factory)
{
if (context.ClassDeclaration == null) return WorkflowResult.Inapplicable;
return CreateNewInterfaceDeclaration(context, factory);
}
private static WorkflowResult CreateNewInterfaceDeclaration(CSharpGeneratorContext context, CSharpElementFactory factory)
{