Skip to content

Instantly share code, notes, and snippets.

View danielmoore's full-sized avatar

Daniel Moore danielmoore

View GitHub Profile
# Git functions
# Mark Embling (http://www.markembling.info/)
# Is the current directory a git repository/working copy?
function isCurrentDirectoryGitRepository {
if ((Test-Path ".git") -eq $TRUE) {
return $TRUE
}
# Test within parent dirs
Get-ChildItem $psScriptRoot -filter *.ps1 | foreach { . $_.FullName }
if(Get-Module prompt) { Remove-Module prompt }
$prompt_kind = if($args[0]) { $args[0] } else { "bash" }
if($prompt_kind -eq "bash") {
function prompt {
@danielmoore
danielmoore / IsAlives.cs
Created May 29, 2011 07:05 — forked from ScottWeinstein/IsAlives.cs
Rx IsAlive UnitTests
// doesn't detect Never()
public static IObservable<bool> IsAlive_Merge<T>(this IObservable<T> source, TimeSpan timeout, IScheduler sched)
{
return source.Select(_ => true)
.Merge(source.Select(_ => false).Throttle(timeout, sched))
.DistinctUntilChanged();
}
// D.Moore, 29 May: using the buffer count should cause this to fire as soon as it's available.
public static IObservable<bool> IsAlive_Buffer<T>(this IObservable<T> source, TimeSpan timeout, IScheduler sched)