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
| interface IAmSomeInterface { | |
| getNumber(): number; | |
| } | |
| interface IAmAGenericInterface<T extends IAmSomeInterface> { | |
| getInstanceOfSomeInterface(id: number): T; | |
| } | |
| class ClassExtendingSomeInterface implements IAmSomeInterface { | |
| getNumber() { |
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( | |
| $beginSha = $(throw '-beginSha is required'), | |
| $endSha = $(throw '-endSha is required'), | |
| $projectName = $( (get-item .).name ) | |
| ) | |
| # Get a list of all the files that have been added/modified/deleted | |
| $filesWithMods = git diff --name-status $beginSha $endSha | Select @{Name="ChangeType";Expression={$_.Substring(0,1)}}, @{Name="File"; Expression={$_.Substring(2)}} |
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
| [SetUpFixture] | |
| public class HackToSetupApprovalTestsToFindP4Merge | |
| { | |
| [SetUp] | |
| public void SetUpFixture() | |
| { | |
| var field = typeof(FirstWorkingReporter).GetField("reporters", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); | |
| var currentItems = (IEnumerable<IEnvironmentAwareReporter>)field.GetValue(DiffReporter.INSTANCE); | |
| var newitems = new[] { P4MergeDiffReporter.INSTANCE }.Concat(currentItems).ToArray(); |
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
| <# | |
| # Little utility to display a toast msg when your external WAN IP address changes | |
| # | |
| # sample command to throw into a scheduled task | |
| # -> powershell.exe -noprofile -file {PathToThisScript}.ps1 {YOUR_EXPECTED_EXTERNAL_WAN_IP} | |
| # | |
| #> | |
| $expectedIpAddress = $args[0] | |
| $ipaddressFound = 'NOT FOUND' |
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
| $history = tf history ./* /recursive /noprompt; | |
| $h = @{}; $history | where { $_ } | select -skip 2 | %{ $val = $_.Substring(10, 13).Trim(); if([string]::IsNullOrEmpty($h[$val])){ $h[$val] = 0; "add $val"; } else{ $val; $h[$val] = $h[$val] + 1} }; $h |
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 msg; | |
| // FizzBuzz 1 | |
| for(var i = 1; i <=100; i++, msg = ''){ | |
| if(i % 5 === 0) | |
| msg = 'Buzz'; | |
| if(i % 3 === 0) | |
| msg += 'Fizz'; |
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 where-is($command) { | |
| (ls env:\path).Value.split(';') | ` | |
| where { $_ } | ` | |
| %{ [System.Environment]::ExpandEnvironmentVariables($_) } | ` | |
| where { test-path $_ } |` | |
| %{ ls "$_\*" -include *.bat,*.exe,*cmd } | ` | |
| %{ $file = $_.Name; ` | |
| if($file -and ($file -eq $command -or ` | |
| $file -eq ($command + '.exe') -or ` | |
| $file -eq ($command + '.bat') -or ` |
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 class Sample | |
| { | |
| [Test] | |
| public void MetadataSample() | |
| { | |
| Items.ItemA.ShouldEqual(Items.ItemA); | |
| Items.ItemA.Description.ShouldEndWith("Description for 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
| public static class EnumerableEx | |
| { | |
| public static IEnumerable<T> Concat<T>(params IEnumerable<T>[] enumerables) | |
| { | |
| if (enumerables == null) throw new ArgumentNullException("enumerables"); | |
| return enumerables.SelectMany(i => i); | |
| } | |
| } |
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 Start-The-Fun() | |
| { | |
| $voice = new-object -com SAPI.SpVoice; | |
| while($true) | |
| { | |
| write-host "->" -NoNewLine; | |
| $msg = read-host; | |
| $Voice.Speak( $msg, 1 ) | out-null; | |
| } |