This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit for this: Nicholas Swift | |
# as found at https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2 | |
from warnings import warn | |
import heapq | |
class Node: | |
""" | |
A node class for A* Pathfinding | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type @" | |
using System; | |
using System.Runtime.InteropServices; | |
public class NativeConsoleMethods | |
{ | |
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | |
public static extern IntPtr GetStdHandle(int handleId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (-not(Get-VMSwitch -SwitchType Internal -ErrorAction SilentlyContinue| Where Name -eq 'Internal-Test' )) { | |
# Create an internal switch on Hyper-V | |
($VMswitch = New-VMSwitch -Name "Internal-Test" -SwitchType Internal) | |
# Set a static IP address on Hyper-V switch | |
Get-NetAdapter | | |
Where Name -eq "vEthernet ($($VMswitch.Name))" | | |
Where InterfaceDescription -match "Hyper-V\sVirtual\sEthernet Adapter" | | |
New-NetIPAddress -IPAddress 10.0.0.1 -PrefixLength 24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################## | |
# Privacy Settings | |
################## | |
# Privacy: Let apps use my advertising ID: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0 | |
# To Restore: | |
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1 | |
# Privacy: SmartScreen Filter for Store Apps: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Expand-Alias { | |
$Editor=$psISE.CurrentFile.Editor | |
$script=$Editor.Text | |
[ref]$errors=$null | |
[System.Management.Automation.PsParser]::Tokenize($script, $errors) | | |
Where { $_.Type -eq 'Command'} | | |
Sort StartLine, StartColumn -Desc | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 5.0.9814.0 | |
if(!($PSVersionTable.PSVersion.Major -ge 5 -and $PSVersionTable.PSVersion.Build -ge 9814)) { | |
"Sorry you need PSVersion 5.0.9814.0 or newer" | |
$psversiontable | |
return | |
} | |
Add-Type -AssemblyName presentationframework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lee Holmes http://www.leeholmes.com/blog/ | |
Oisin G http://www.nivot.org/ | |
Jaykul http://huddledmasses.org/ | |
Vadim Podams http://sysadmins.lv/ | |
Roman Kuzmin http://nightroman.wordpress.com/ | |
Matt Graeber http://www.exploit-monday.com/ | |
Joe Bialek http://clymb3r.wordpress.com/ | |
Glenn Sizemore https://twitter.com/glnsize | |
Bartek Bielawski http://becomelotr.wordpress.com/ | |
Jim Christopher http://www.beefycode.com/default.aspx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-MsiProductVersion { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)] | |
[ValidateScript({$_ | Test-Path -PathType Leaf})] | |
[string] | |
$Path | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |