Skip to content

Instantly share code, notes, and snippets.

@mburbea
mburbea / Bits.cs
Last active February 24, 2019 12:51
namespace System {
// Little-Endian based approaches most likely do not work on big-endian hardware.
// Code based on examples found in
// Bit Twiddling hacks:
// https://graphics.stanford.edu/~seander/bithacks.html
// Chess programming wiki:
// https://chessprogramming.wikispaces.com/BitScan
public static class Bits
{
@hmemcpy
hmemcpy / undef.md
Last active November 21, 2023 16:46
Disabling Visual Studio Git Provider

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!

  • 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
@vbfox
vbfox / nullarg.DotSettings
Created November 26, 2014 17:16
NullReferenceException check -> custom function with ReSharper Structural Search And replace
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=2F4A0295AA4DD848965FCA6DA262D8B4/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=2F4A0295AA4DD848965FCA6DA262D8B4/Comment/@EntryValue">ArgumentNullException Thrown</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=2F4A0295AA4DD848965FCA6DA262D8B4/IsReplacePattern/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=2F4A0295AA4DD848965FCA6DA262D8B4/LanguageName/@EntryValue">CSHARP</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=2F4A0295AA4DD848965FCA6DA262D8B4/ReplaceComment/@EntryV
@adamralph
adamralph / notes.csx
Last active August 29, 2015 14:04
Create release notes from GitHub issues with power of scriptcs and Octokit!
var owner = "scriptcs";
var repo = "scriptcs";
var milestone = "v0.10";
var labels = new Dictionary<string, string>{ { "feature", "New" }, { "bug", "Fixed" } };
var username = "adamralph";
var oAuthToken = "secret";
var client = Require<OctokitPack>().CreateWithOAuth("ScriptCs.ReleaseNotesScript", username, oAuthToken);
var issues = client.Issue.GetForRepository(owner, repo, new RepositoryIssueRequest { State = ItemState.Closed, }).Result;
using System.Threading;
Console.Beep(659, 125);
Console.Beep(659, 125);
Thread.Sleep(125);
Console.Beep(659, 125);
Thread.Sleep(167);
Console.Beep(523, 125);
Console.Beep(659, 125);
Thread.Sleep(125);
using System.Threading;
Console.Beep(658, 125);
Console.Beep(1320, 500);
Console.Beep(990, 250);
Console.Beep(1056, 250);
Console.Beep(1188, 250);
Console.Beep(1320, 125);
Console.Beep(1188, 125);
Console.Beep(1056, 250);
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\15.0\Lync]
"DisableServerCheck"=dword:00000001
[AttributeUsage(System.AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class ಠ_ಠAttribute : Attribute
{
public ILog Log { get; set; }
public ಠ_ಠAttribute()
{
Log.Info("This code is bad and you should feel bad");
}
}