Skip to content

Instantly share code, notes, and snippets.

View cbilson's full-sized avatar

Chris Bilson cbilson

View GitHub Profile
public interface IFileSaverService {
void SaveFile(byte[] bytes, string filename);
}
public class LocalFileSystemSaver : IFileSaverService {
public void SaveFile(byte[] bytes, string filename) {
...
}
}
public class ClientController : BaseController {
private IClientManagementService _clientManagementService = null;
public ClientController(IClientManagementService clientManagementService) {
_clientManagementService = clientManagementService;
}
// this will work both for an HTTP GET (the returned value will got into the property
// bag for the view to use) or for a JSON response (just like JsonReturnBinder - in fact
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.ComponentModel;
using WpfApplication1.Models;
namespace WpfApplication1.ViewModels
{
#light
let ( ||| ) p1 p2 s =
match p1 s with
| Some _ as v -> v
| None -> p2 s
let ( ++ ) p1 p2 s =
match p1 s with
| None -> None
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Castle.MonoRail.Framework;
using System.Collections;
using System.Reflection;
using Newtonsoft.Json;
using System.IO;
using System.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Castle.Windsor;
using Castle.Core.Resource;
using Castle.MonoRail.WindsorExtension;
using Ris.Fx.Web.Controllers;
using Castle.MicroKernel.Registration;
using Castle.MonoRail.Framework;
;;
;; my .emacs for the linux machine I am about to repurpose...
;;
(add-to-list 'load-path "~/.emacs.d")
;;
;; Use Consolas as my default font
;;
;;(set-default-font "Consolas-11")
#light
open System.Web
open System.Collections.Generic
open System.Text.RegularExpressions
let handlers = new List<(string -> bool) * (HttpContext -> unit)>()
let find_handler_for (ctxt:HttpContext) =
handlers |> Seq.tryfind (fun h -> ctxt.Request.Path |> fst h)
. .\Scripts\Startup.ps1
$integrationFixture = "$env:ProjectRoot\Product\IntegrationTests\Ris.Fx.Integration.Tests\bin\Debug\Ris.Fx.Integration.Tests.dll"
function Start-WebDev {
$webdev = "$env:CommonProgramFiles\Microsoft Shared\DevServer\9.0\WebDev.WebServer.exe"
$webdir = "$env:ProjectRoot\Product\Production\Ris.Fx.Web"
$arguments = @(
'/port:9008',
;===============================================================================
; Map C-L to "cls" in console windows, like most unix-ish terminals do
;===============================================================================
SendMode Input
#IfWinActive ahk_class ConsoleWindowClass
^L::
Send cls{Enter}
#IfWinActive