Skip to content

Instantly share code, notes, and snippets.

@davidfowl
davidfowl / dotnetlayout.md
Last active April 26, 2024 13:37
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@Michael-1
Michael-1 / stackexchange-sort-ignoring-accepted.user.js
Last active April 21, 2018 05:53
On Stack Exchange, the accepted answer is only at the top if there is no other answer with more votes
// ==UserScript==
// Author Michael Schmid <michael.schmid@live.com>
// Forked from http://userscripts.org/scripts/show/57812
// @name Stack Exchange: sort answers by votes
// @namespace michael
// @description Accepted answer is only at the top if there is no other answer with more votes
// @include http://stackoverflow.com/questions/*
// @include http://serverfault.com/questions/*
// @include http://superuser.com/questions/*
// @include http://stackapps.com/questions/*
@VertigoRay
VertigoRay / CatchLineNumbers.ps1
Last active January 15, 2017 06:01
The `$MyInvocation.ScriptLineNumber` variable is not the Current Line Number. It’s the Line number from where the function that you’re in was called. Actual line numbers can be caught for an error if you catch them. Used in this comment: http://goo.gl/7oeSEL
function a {
param(
[string]$UninstallString = 'thing'
)
$MyInvocation
Write-Host -Fore Cyan "$($here.File) $($MyInvocation.MyCommand):$($MyInvocation.ScriptLineNumber)"
b
try {
Throw('Thing!!!!')