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
| class Konsole : IDisposable | |
| { | |
| ConsoleColor _orig_fg; | |
| public static IDisposable Color(ConsoleColor fg) | |
| { | |
| var k = new Konsole() | |
| { | |
| _orig_fg = Console.ForegroundColor | |
| }; |
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
| param | |
| ( | |
| [Parameter(Mandatory=$True)][string]$srcPath, | |
| [string]$dstPath = "." | |
| ) | |
| $local_path = join-path $env:LOCALAPPDATA "cppwinrt.android" | |
| if (-not (test-path $local_path)) { | |
| mkdir $local_path | out-null | |
| } |
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
| open System | |
| // helper function to set the console collor and automatically set it back when disposed | |
| let consoleColor (fc : ConsoleColor) = | |
| let current = Console.ForegroundColor | |
| Console.ForegroundColor <- fc | |
| { new IDisposable with | |
| member x.Dispose() = Console.ForegroundColor <- current } | |
| // printf statements that allow user to specify output color |
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
| open System | |
| // helper function to indent an indexedTextWriter and automatically un-indent | |
| // when disposed | |
| let indent (itw : System.CodeDom.Compiler.IndentedTextWriter) = | |
| let current = itw.Indent | |
| itw.Indent <- current + 1 | |
| { new IDisposable with | |
| member x.Dispose() = itw.Indent <- current } |
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
| using System.Runtime.CompilerServices; | |
| using Windows.Foundation; | |
| static class WinRtHelper | |
| { | |
| struct VoidValueTypeParameter { } | |
| public static TaskAwaiter GetAwaiter(this IAsyncAction op) | |
| { | |
| var tcs = new TaskCompletionSource<VoidValueTypeParameter>(); |
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
| param([Parameter(Mandatory=$true)][string]$filename, [string]$displayname) | |
| $local:windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent() | |
| $local:windowsPrincipal = new-object 'System.Security.Principal.WindowsPrincipal' $local:windowsIdentity | |
| if ($local:windowsPrincipal.IsInRole("Administrators") -ne 1) | |
| { | |
| throw "add-bcd-vhd must be run from an administrator account" | |
| } | |
| $f = resolve-path $filename |
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
| <!-- Add to .vcxproj file after line importing $(VCTargetsPath)\Microsoft.Cpp.props to have sensible build output folders --> | |
| <!-- have VC++ emit build artifacts into \bin and \obj folders like managed proejcts do --> | |
| <PropertyGroup> | |
| <!-- | |
| The VC++ build scripts automatically appends atrailing slash on OutDir, which annoys some tools, | |
| so I added OutputDirectory w/o the slash. Also, I'm using "PlatformShortName" so x86 binaries don't | |
| end up in the "win32" directory | |
| --> |
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
| using System; | |
| using System.Linq; | |
| using System.Reflection; | |
| using Microsoft.Framework.DependencyInjection; | |
| using Microsoft.Framework.Runtime; | |
| namespace CustomCommands | |
| { | |
| public class Program | |
| { |
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
| function Run-Boxstarter-From-Gist($gistId, $fileName) { | |
| Invoke-WebRequest "https://api.github.com/gists/$gistId" -UseBasicParsing | ConvertFrom-Json | %{ | |
| $local:boxstarterUrl = "http://boxstarter.org/package/url?$($_.files.$fileName.raw_url)" | |
| & 'C:\Program Files\Internet Explorer\iexplore.exe' -new $local:boxstarterUrl | |
| } | |
| } | |
| Run-Boxstarter-From-Gist d5e9d66238717bab0e23 basicconfig.ps1 | |
| Run-Boxstarter-From-Gist d5e9d66238717bab0e23 devcconfig.ps1 |
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
| # Enable-RemoteDesktop | |
| # Install-WindowsUpdate -Full | |
| Update-ExecutionPolicy RemoteSigned | |
| #cinst boxstarter | |
| #cinst git | |
| #cinst git-credential-winstore | |
| cinst notepad2-mod | |
| cinst 7zip | |
| #cinst nodejs |