Skip to content

Instantly share code, notes, and snippets.

@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 <[email protected]>
// 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/*
@davidfowl
davidfowl / dotnetlayout.md
Last active June 6, 2025 15:28
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@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!!!!')