This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GitHub Markdown shortcuts | |
// @namespace ThomasLevesque | |
// @include https://github.com/* | |
// @include https://gist.github.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
└─┬ [email protected] | |
├─┬ [email protected] | |
│ ├── [email protected] | |
│ ├── [email protected] | |
│ ├─┬ [email protected] | |
│ │ ├── [email protected] | |
│ │ ├─┬ [email protected] | |
│ │ │ └─┬ [email protected] | |
│ │ │ └── [email protected] | |
│ │ ├── [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[repo] | |
defaultRemoteName = origin | |
mainBranchName = master | |
[alias] | |
diffc = diff --cached | |
logg1 = log --graph --oneline | |
current-branch = rev-parse --abbrev-ref HEAD | |
publish = !git push -u $(git config repo.defaultRemoteName) $(git current-branch) | |
finish-branch = !branchName=$(git current-branch) && git fetch $(git config repo.defaultRemoteName) $(git config repo.mainBranchName):$(git config repo.mainBranchName) && git checkout $(git config repo.mainBranchName) && git branch -d $branchName && git fetch -p $(git config repo.defaultRemoteName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Solution for James Michael Hare's anagram challenge (http://geekswithblogs.net/BlackRabbitCoder/archive/2015/07/28/little-puzzlersndashlist-all-anagrams-for-a-word.aspx) | |
// Run in LinqPad, adding a reference to Microsoft.Experimental.Collections | |
void Main() | |
{ | |
string path = @"D:\tmp\words.txt"; | |
var dict = new MultiValueDictionary<string, string>(); | |
foreach (var word in File.ReadLines(path)) | |
{ | |
dict.Add(new string(word.OrderBy(c => c).ToArray()), word); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var array = new byte[10000000]; | |
var initBlk = new InitblkMemoryHelper(); | |
var loop = new LoopMemoryHelper(); | |
// First run for JIT warmup and type initialization | |
initBlk.Memset(array, 0, array.Length, 42); | |
loop.Memset(array, 0, array.Length, 42); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace System.Runtime.CompilerServices | |
{ | |
[AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = false)] | |
public sealed class CallerMemberNameAttribute : Attribute | |
{ | |
} | |
[AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = false)] | |
public sealed class CallerFilePathAttribute : Attribute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using NUnit.Framework; | |
namespace MyLibrary.Tests.XEnumerableTests | |
{ | |
[TestFixture] | |
class FullOuterJoinTests | |
{ | |
[Test] | |
public void FullOuterJoin_Throws_If_Argument_Null() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
namespace Utils.Threading | |
{ | |
/// <summary> | |
/// A cancellable replacement for Thread.Sleep | |
/// </summary> | |
public static class Sleeper | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
using Sharebox.Utils.Collections; | |
namespace Sharebox.Communication | |
{ | |
class BasicAuthenticationModule : IAuthenticationModule | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var pb = new PictureBox { Image = Image.FromFile(@"D:\tmp\dotnet.png") }; | |
bool down = false; | |
Cursor dragCursor = null; | |
pb.MouseDown += (sender, e) => down = true; | |
pb.MouseUp += (sender, e) => { down = false; dragCursor = null; }; | |
pb.MouseMove += (sender, e) => | |
{ | |
if (down) |