Skip to content

Instantly share code, notes, and snippets.

View cbilson's full-sized avatar

Chris Bilson cbilson

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
namespace DbSlim
{
public class Insert
{
private string connectionString;
#-------------------------------------------------------------------------------
# Downloads photos from National Geographic's Photo Contest
#-------------------------------------------------------------------------------
param($res = '1280', $year = '2008')
$client = New-Object System.Net.WebClient
$client.Headers.Add('User-agent', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)')
$prefixes = @{
'2008' = @('1107', '1103', '1027', '1020', '1014', '1006', '0929', '0922',
public class when_a_benchmark_has_more_than_3_percent_assets_more_than_5_percent_change_in_weight
{
Establish context = () =>
{
Input input;
given.input.for_account("XYZ123").called(out input)
.with_position().on(Clock.Today)
.with_an_asset_valued_at(10).cusip("1")
.with_an_asset_valued_at(90).cusip("2")
namespace StupidExample {
public class CustomerGateway {
IUnitOfWorkManager work;
public CustomerGateway(IUnitOfWorkManager work) { this.work = work; }
public IEnumerable<Customer> GetNewCustomersSince(DateTime time) {
work.On("CustomerDB", session =>
session.CreateCriteria<Customer>()
function Hello($name) {
"Hello, $name, from included file."
}
;===============================================================================
; 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
. .\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',
#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)
;;
;; 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")
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;