Skip to content

Instantly share code, notes, and snippets.

View asizikov's full-sized avatar
💭
💻

Anton Sizikov asizikov

💭
💻
View GitHub Profile
protected IObservable<T> GetDataAsync<T>(RestfullRequest<T> request) where T : new()
{
if (!_cache.IsCached<T>(request.Url))
{
Debug.WriteLine("Getting data:" + request.Url);
return Observable.Create<T>(
observer =>
Scheduler.Default.Schedule(() => ExecuteRequest(request, observer))
);
}
Assuming that clearing the WinInet cache solves the problem, you can delete files programmatically by P/Invoking to the DeleteUrlCacheEntry WinInet API:
public static class NativeMethods
{
[DllImport("WinInet.dll", PreserveSig = true, SetLastError = true)]
public static extern void DeleteUrlCacheEntry(string url);
}
/////////////
@asizikov
asizikov / undef.md
Last active August 29, 2015 14:24 — forked from hmemcpy/undef.md

Here's how to disable the package that is responsible for loading the Git source control support in Visual Studio. Use at your own risk: this will probably break CodeLens' git integration. But you're not using that, are you? :)

  • Create a file called devenv.pkgundef and place it next to devenv.exe in you Visual Studio's Common7\IDE (you'll need elevation for this)
  • Add the following entries to the file:
[$RootKey$\Packages\{7fe30a77-37f9-4cf2-83dd-96b207028e1b}]
[$RootKey$\SourceControlProviders\{11b8e6d7-c08b-4385-b321-321078cdd1f8}]
  • Close VS if open, open a Developer command prompt, and type devenv /updateconfiguration
$configFilePath = "C:\your\path\to\config.Release.config"
$octopusProject = "octopus-project-name"
$apiKey = "key"
$environments = @("Dev","Test","Production")
@asizikov
asizikov / FindConflictingReferences.cs
Created October 22, 2015 16:14 — 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]
@asizikov
asizikov / deployment.cs
Created November 1, 2015 19:01
Creating Deployment
var newDeployment = new NewDeployment();
newDeployment.Ref = "branch-name";
newDeployment.Description = "deploing branch";
var deployment = await Client.Repository.Deployment.Create(owner,repo, newDeployment);
var deploymentStatus = new NewDeploymentStatus();
deploymentStatus.Description = "done";
deploymentStatus.State = DeploymentState.Success;
deploymentStatus.TargetUrl = "https:\\deployments.company.com";
await Client.Repository.Deployment.Status.Create(owner,repo,deployment.Id,deploymentStatus);
#add to your ~/.bash_profile
alias octo='curl -sb -H https://api.github.com/octocat 2>/dev/null'
@asizikov
asizikov / Branches.AppVeyor.yaml
Created January 5, 2016 22:10
Branches.AppVeyor
-
branches:
only:
- master
- develop
configuration: Release
-
branches:
only:
- /feature/.*/
[assembly: RegisterConfigurableSeverity(ConsiderUsingAsyncSuffixHighlighting.SeverityId,
null,
HighlightingGroupIds.BestPractice,
"Consider adding Async suffix",
"According to Microsoft gudlines a method which is Task-returning and is asynchronous in nature should have an 'Async' suffix. ",
Severity.SUGGESTION,
false)]