Skip to content

Instantly share code, notes, and snippets.

View dariusz-wozniak's full-sized avatar
🏀

Dariusz Woźniak dariusz-wozniak

🏀
View GitHub Profile
@dariusz-wozniak
dariusz-wozniak / emendash.ahk
Last active June 5, 2020 03:15
AutoHotkey - Em Dash and En Dash
; en dash
!NumpadSub::
Send, {ASC 0150}
return
; em dash
!NumpadAdd::
Send, {ASC 0151}
return
@dariusz-wozniak
dariusz-wozniak / NestedObjectInitializerSyntax.cs
Created October 12, 2014 16:18
Nested Object Initializer Syntax
public class NestedInitializerExample
{
public void Init()
{
Rectangle rectangle = new Rectangle
{
P1 = { X = 0, Y = 1 },
P2 = { X = 2, Y = 3 }
};
}
@dariusz-wozniak
dariusz-wozniak / gist:45d72f78bccb9d57e5af
Created September 7, 2014 15:56
Code Contracts: Contract.Requires
public int Add(int a, int b)
{
Contract.Requires<ArgumentOutOfRangeException>(a >= 0);
Contract.Requires<ArgumentOutOfRangeException>(b >= 0);
// ...
}