Skip to content

Instantly share code, notes, and snippets.

@therealjohn
therealjohn / ralph-loop.ps1
Created January 30, 2026 03:14 — forked from shanselman/ralph-loop.ps1
PowerShell Ralph Loop for GitHub Copilot CLI - Based on David Fowler's bash script and Geoffrey Huntley's Ralph pattern for autonomous AI coding agents
# Ralph Agent Loop Script for GitHub Copilot CLI (PowerShell)
# Continuously runs Copilot CLI on a task until completion criteria is met
# Usage: .\ralph-loop.ps1 <job-name>
param(
[Parameter(Mandatory=$true, Position=0)]
[string]$JobName
)
# Configuration (can be overridden via environment variables)
@therealjohn
therealjohn / AsyncHelper.cs
Created December 15, 2016 16:46 — forked from rid00z/AsyncHelper.cs
This code can be used to task a async task and run it without the async part.
public static class AsyncHelper
{
private static readonly TaskFactory _myTaskFactory = new
TaskFactory(CancellationToken.None,
TaskCreationOptions.None,
TaskContinuationOptions.None,
TaskScheduler.Default);
public static TResult RunSync<TResult>(Func<Task<TResult>> func)
{
class DataTaskDelegate : NSUrlSessionDataDelegate
{
NSUrlSessionHandler This { get; set; }
public DataTaskDelegate(NSUrlSessionHandler that)
{
this.This = that;
}
public override void DidReceiveChallenge(NSUrlSession session, NSUrlSessionTask task, NSUrlAuthenticationChallenge challenge, Action<NSUrlSessionAuthChallengeDisposition, NSUrlCredential> completionHandler)