This file contains hidden or 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
//conway's Game of Life in F# (w/ WPF) for Linq Pad | |
// add refs to PresentationCore, PresentationFramework, and System.Windows | |
let count (a: _ [,]) x y = | |
let m, n = a.GetLength 0, a.GetLength 1 | |
let mutable c = 0 | |
for x in x-1..x+1 do | |
for y in y-1..y+1 do | |
if x>=0 && x<m && y>=0 && y<n && a.[x, y] then | |
c <- c + 1 | |
if a.[x, y] then c-1 else c |
This file contains hidden or 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
// LinqPad example of ref keyword in C# | |
// "in c# objects are always passed by reference" -- NOT TRUE!!! | |
// what actually happens is that references are always passed by value! | |
// using the ref keyword passes the reference explicitly | |
void Main() | |
{ | |
var s = new StringBuilder("hello"); | |
Console.WriteLine(s.ToString()); | |
This file contains hidden or 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
# with hyper-v: http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/rleopold/2c002816d5b1b9a48bbd/raw/974b6525126618d244d8a0ec08f3e89e88e9af69/chocodevbox | |
# http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/rleopold/2c002816d5b1b9a48bbd/raw/d9b0383eb01c2d32bb1d7a619f96b47a9b7fef57/chocodevbox | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
cinst git | |
cinst poshgit | |
cinst 7zip | |
cinst nodejs |
This file contains hidden or 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
# -------------------------------------------------------------------- | |
# Checking Execution Policy | |
# -------------------------------------------------------------------- | |
$Policy = "Unrestricted" | |
If ((get-ExecutionPolicy) -ne $Policy) { | |
Write-Host "Script Execution is disabled. Enabling it now" | |
Update-ExecutionPolicy $Policy | |
} | |
Import-Module WebAdministration |
This file contains hidden or 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
$networks = netsh wlan show profiles | select-string 'All User Profile' | |
if($networks.Count -gt 0) { | |
$(foreach ($item in $networks) { | |
$item.Line.Split(':')[1].Trim() | |
}) | Out-GridView -Title 'Select one or more neowrks to forget' -OutputMode Multiple | | |
foreach { | |
netsh wlan delete profile name = "$_" | |
} | |
} |