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 WinRTMetadataResolver : MetadataResolver | |
| { | |
| public WinRTMetadataResolver(IAssemblyResolver resolver) | |
| : base(resolver) | |
| { | |
| } | |
| IDictionary<string, ModuleDefinition> _loadedModules = new Dictionary<string, ModuleDefinition>(); | |
| public override TypeDefinition Resolve(TypeReference type) |
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 () { | |
| var | |
| // The username and password for BASIC auth | |
| username, | |
| password, | |
| // CHANGE THIS | |
| apiRoot = "https://api.foo.com/version", |
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 get-bitrate( $file) { | |
| $shell = New-Object -ComObject Shell.Application | |
| $dir = $shell.NameSpace($file.Directory.FullName) | |
| $fileObj = $dir.parseName($file.Name) | |
| $bitrateAttribute = 0 | |
| for( $index = 5; -not $bitrateAttribute; ++$index ) { | |
| $name = $directoryObject.GetDetailsOf( $dir.Items, $index ) | |
| if( $name -eq 'Bit rate' ) { $bitrateAttribute = $index } | |
| } |
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
| var authClient = new LiveAuthClient(); | |
| LiveLoginResult authResult = await authClient.LoginAsync( | |
| new List<string>() { "wl.signin", "wl.basic" }); | |
| if (authResult.Status == LiveConnectSessionStatus.Connected) | |
| { | |
| LiveConnectClient client = new LiveConnectClient(authResult.Session); | |
| LiveOperationResult liveOpResult = await client.GetAsync("me"); | |
| string name = (string)liveOpResult.Result["name"]; | |
| } |
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
| static class ObservableExtensions | |
| { | |
| public static IObservable<TSource> CompleteAfter<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate) | |
| { | |
| return new AnonymousObservable<TSource>(observer => | |
| { | |
| var complete = false; | |
| return source.Subscribe( | |
| x => | |
| { |
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
| Sub RemoveAllDeletedItemsSubFolders() | |
| Dim oDeletedItems As Outlook.Folder | |
| Dim oFolders As Outlook.Folders | |
| Dim oItems As Outlook.Items | |
| Dim i As Long | |
| 'Obtain a reference to deleted items folder | |
| Set oDeletedItems = Application.Session.GetDefaultFolder(olFolderDeletedItems) | |
| Set oFolders = oDeletedItems.Folders | |
| For i = oFolders.Count To 1 Step -1 |
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 |
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
| 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
| <!-- 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 | |
| --> |