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 / 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);
// ...
}
@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 / 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 / Git-ShowRemoteBranches.ps1
Created October 28, 2016 17:10
Git-ShowRemoteBranches.ps1
function Git-ShowRemoteBranches($filter)
{
if ($filter)
{
git remote show origin | sls $filter
}
else
{
git remote show origin
}
@dariusz-wozniak
dariusz-wozniak / RunSlackMinimized.ahk
Last active January 15, 2021 22:22
Run Slack Minimized (AutoHotkey script)
Run, %USERPROFILE%\AppData\Local\slack\Update.exe --processStart "slack.exe", , Normal
WinWait, ahk_exe slack.exe
Loop, 50
{
WinHide, ahk_exe slack.exe
Sleep, 200
}
@dariusz-wozniak
dariusz-wozniak / OpenPreyConfig.ps1
Created October 28, 2016 17:11
OpenPreyConfig.ps1
C:\Windows\Prey\current\bin\prey config gui -f
@dariusz-wozniak
dariusz-wozniak / telemetry.ps1
Created February 20, 2018 16:20
Opt-out from .NET Core telemetry
setx DOTNET_CLI_TELEMETRY_OPTOUT 1
@dariusz-wozniak
dariusz-wozniak / gimmesomeguids.ps1
Last active June 22, 2018 13:25
Gimme some GUIDs
1..10 | foreach { [Guid]::newguid() }
#SPACE:: Winset, Alwaysontop, , A
@dariusz-wozniak
dariusz-wozniak / javascript-fundamentals-notes.js
Last active January 19, 2019 20:16
📝 JavaScript Fundamentals (Pluralsight course) — Notes
// IIFE:
let app = (function() {
console.log("weheh");
let carId = 123;
let getId = function() {
return carId * 2;
};
return {