Skip to content

Instantly share code, notes, and snippets.

@janv8000
janv8000 / gist:5003189
Created February 21, 2013 08:28
QueryNullableHasValue test for RavenDB
using System;
using System.Linq;
using Xunit;
namespace Raven.Tests.Bugs
{
public class QueryNullableHasValue : RavenTest
{
[Fact]
public void CanQueryWithNullComparison()
@janv8000
janv8000 / gist:5909585
Created July 2, 2013 14:05
Run Windows 8.1 preview in VirtualBox
<ExtraDataItem name="VBoxInternal/CPUM/CMPXCHG16B" value="1"/>
@janv8000
janv8000 / CustomRules.js
Created February 13, 2014 10:00
Hide BrowserLink requests in Fiddler
// First add the option in the Rules menu:
// Add these lines after the other options (m_Japanese ...)
// Enables hiding of VS2013 BrowserLink feature requests
public static RulesOption("Hide SignalR/BrowserLink")
var m_SignalRBrowserLink: boolean = false;
// Add the following at the end of OnBeforeRequest
if (m_SignalRBrowserLink && (oSession.uriContains("SignalR") || oSession.uriContains("__BrowserLink") || oSession.oRequest.headers.RequestPath.EndsWith("/browserLink"))){
oSession["ui-hide"] = "SignalR";
}
<TestFixture()>
Public Class StackOverflowQuestion6556077Test
Private _originalList As Record()
Private Class Record
Public Country As String
Public CountryID As Integer
End Class
<SetUp>

Keybase proof

I hereby claim:

  • I am janv8000 on github.
  • I am janv8000 (https://keybase.io/janv8000) on keybase.
  • I have a public key whose fingerprint is D148 7CE2 876B 2BDF 47BA 4E7A F2EA B361 5DC1 4D8C

To claim this, I am signing this object:

@janv8000
janv8000 / CssRewriteUrlTransformIgnoringDataUri.cs
Created July 11, 2014 13:37
CssRewriteUrlTransform data URI workaround
/// <remarks>Part of Microsoft.AspNet.Web.Optimization.1.1.3, forked to ignore data-uri</remarks>
public class CssRewriteUrlTransformIgnoringDataUri : IItemTransform
{
internal static string RebaseUrlToAbsolute(string baseUrl, string url)
{
if (string.IsNullOrWhiteSpace(url) || string.IsNullOrWhiteSpace(baseUrl) || url.StartsWith("/", StringComparison.OrdinalIgnoreCase))
return url;
if (!baseUrl.EndsWith("/", StringComparison.OrdinalIgnoreCase))
baseUrl = baseUrl + "/";
return VirtualPathUtility.ToAbsolute(baseUrl + url);
@janv8000
janv8000 / AsyncRunner.cs
Created January 12, 2015 13:32
Start background tasks from MVC actions using Autofac
public interface IAsyncRunner
{
void Run<T>(Action<T> action);
}
public class AsyncRunner : IAsyncRunner
{
public ILifetimeScope LifetimeScope { get; set; }
public AsyncRunner(ILifetimeScope lifetimeScope)
@janv8000
janv8000 / gist:2d7dba3f0b76737ec0c3
Last active January 15, 2016 15:40
Notepad++ as git editor
git config --global core.editor notepad.exe
git config -–global -e
en dan ergens
[core]
editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession –noPlugin
@janv8000
janv8000 / Get-FrameworkVersions.ps1
Last active May 24, 2018 14:25 — forked from drmohundro/Get-FrameworkVersions.ps1
PowerShell script to return all installed .NET Framework versions.
<#
.Synopsis
Returns the install .NET Framework versions.
.Description
The script looks through the registry using the notes from the below
MSDN links to determine which versions of .NET are installed.
public class DatabaseDeleter
{
private readonly ISessionFactory _configuration;
private static readonly string[] _ignoredTables = new[] { "sysdiagrams", "usd_AppliedDatabaseScript" };
private static string[] _tablesToDelete;
private static string _deleteSql;
private static object _lockObj = new object();
private static bool _initialized;
public DatabaseDeleter(ISessionFactory sessionSource)