Skip to content

Instantly share code, notes, and snippets.

@jefflward
jefflward / Windows Defender Exclusions VS 2022.ps1
Last active May 2, 2022 19:57 — forked from dknoodle/Windows Defender Exclusions VS 2017.ps1
Adds Windows Defender exclusions for Visual Studio 2022
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files\Microsoft Visual Studio\2022') > $null
@tomzorz
tomzorz / Enable_vt100_csharp.cs
Created April 12, 2017 19:26
Enable VT100 for the current console window from .NET Core
using System;
using System.Runtime.InteropServices;
namespace Vt100Test
{
public class Program
{
// ReSharper disable InconsistentNaming

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@schottra
schottra / escapeHandlerMixin.js
Last active August 29, 2015 14:19
A reusable escape handler mixin that will call a function of your choice when escape is pressed and automatically detach when the scope is destroyed
angular.module('myModule').factory('escapeHandler', function($document){
var ESCAPE_KEY = 27;
return function(scope, handler){
var eventHandler = function(keyEvent){
if(keyEvent.keyCode === ESCAPE_KEY){ // use `keyCode`, not `which`
scope.$apply(handler);
}
};
$document[0].addEventListener('keydown', eventHandler, true); // using capture mode
@niik
niik / CryptoRandom.cs
Created June 9, 2011 21:48
Buffered CryptoRandom implementation based on Stephen Toub and Shawn Farkas' CryptoRandom
/*
* Original version by Stephen Toub and Shawn Farkas.
* Random pool and thread safety added by Markus Olsson (freakcode.com).
*
* Original source: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx
*
* Some benchmarks (2009-03-18):
*
* Results produced by calling Next() 1 000 000 times on my machine (dual core 3Ghz)
*