😶🌫️
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 foo = 'baz'; | |
| var bar: any; | |
| bar = foo === 'true' ? true : foo === 'false' ? false : foo; |
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 (global) { | |
| var walker = function (k, t, o) { | |
| if(!t) { | |
| t = k; | |
| } else { | |
| t = t + k + '/'; | |
| } | |
| if(typeof o !== 'object') { | |
| if(t) { | |
| require.define(t.substring(0, t.length - 1), function (r, m, e) { |
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
Show hidden characters
| { | |
| "cmd": ["make"], | |
| "working_dir":"${project_path}", | |
| "windows": { | |
| "cmd": ["C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/nmake"] | |
| } | |
| } |
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 localPath = "Some Path"; | |
| if (!Workstation.Current.IsMapped(localPath)) { | |
| Log.LogError(string.Format("The local path '{0}' is not mapped to a TFS workspace.", LocalPath)); | |
| return false; | |
| } | |
| var info = Workstation.Current.GetLocalWorkspaceInfo(localPath); | |
| var collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(info.ServerUri); | |
| var workspace = info.GetWorkspace(collection); | |
| var localVersions = workspace.GetLocalVersions(new [] {new ItemSpec(localPath, RecursionType.Full)}, false); |
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
| Array.prototype.selectMany = function (fn) { | |
| return this.map(fn).reduce(function (x, y) { return x.concat(y); }, []); | |
| }; | |
| // usage | |
| console.log([[1,2,3], [4,5,6]].selectMany(function (x) { return x; })); //[1,2,3,4,5,6] | |
| console.log([{ a: [1,2,3] }, { a: [4,5,6] }].selectMany(function (x) { return x.a; })); |
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
| [TestClass] | |
| class Tests { | |
| [TestMethod] | |
| public void DataSet_A() { | |
| RunTestWithData("A", "Z"); | |
| } | |
| [TestMethod] | |
| public void DataSet_B() { | |
| RunTestWithData("B", "Y"); |
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
| $(document).on('click', '#showInvestigated', function () { | |
| window.location = '@Html.Raw(Url.Action("StoreErrors"))'; | |
| }); |
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
| module PubSub { | |
| interface ISubscription { | |
| (...args: any[]): void; | |
| } | |
| interface IDictionary { | |
| [name: string] : ISubscription[]; | |
| } | |
| var registry : IDictionary = { |
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
| Windows.Storage.StorageFolder.prototype.fileExistsAsync = function(fileName) { | |
| var folder = this; | |
| return WinJS.Promise(function (complete, error) { | |
| folder.getFileAsync(fileName).then(function() { | |
| complete(); | |
| }, function() { | |
| error(); | |
| }); | |
| }); | |
| }; |
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
| public static class StorageFolderExtensions | |
| { | |
| public static async Task<bool> FileExistsAsync(this StorageFolder folder, string fileName) | |
| { | |
| try | |
| { | |
| await folder.GetFileAsync(fileName); | |
| return true; | |
| } | |
| catch (FileNotFoundException) |